LeviLamina
Loading...
Searching...
No Matches
AmbientSoundController.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/sound/LoopSoundStage.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/deps/ecs/WeakEntityRef.h"
9#include "mc/platform/brstd/function_ref.h"
10#include "mc/world/actor/player/PlayerListener.h"
11#include "mc/world/level/biome/BiomeIdType.h"
12
13// auto generated forward declare list
14// clang-format off
15class BlockPos;
16class Player;
17class SoundMapping;
18class Vec3;
19struct BrightnessPair;
20// clang-format on
21
23public:
24 // AmbientSoundController inner types define
25 using PlaySoundFunc = ::brstd::function_ref<void(::HashedString const&, ::Vec3 const&)>;
26
27 using LightThresholdFunc = ::brstd::function_ref<bool(::BrightnessPair, ::BlockPos const&, ::BrightnessPair)>;
28
29public:
30 // member variables
31 // NOLINTBEGIN
32 ::ll::TypedStorage<4, 4, ::LoopSoundStage> mLoopSoundStage;
33 ::ll::TypedStorage<8, 24, ::WeakEntityRef> mLocalUser;
34 ::ll::TypedStorage<8, 8, ::SoundMapping const&> mSoundMap;
35 ::ll::TypedStorage<8, 8, ::std::chrono::steady_clock::time_point> mNextSoundChangeTime;
36 ::ll::TypedStorage<4, 4, int> mDelayUntilNextMoodSound;
37 ::ll::TypedStorage<2, 2, ::BiomeIdType> mTargetLoopBiomeId;
38 ::ll::TypedStorage<8, 48, ::HashedString> mTargetAmbientLoopSound;
39 ::ll::TypedStorage<2, 2, ::BiomeIdType> mCurrentLoopBiomeId;
40 ::ll::TypedStorage<8, 48, ::HashedString> mCurrentAmbientLoopSound;
41 ::ll::TypedStorage<8, 8, uint64> mCurrentLoop;
42 ::ll::TypedStorage<8, 8, uint64> mPreviousLoop;
43 ::ll::TypedStorage<4, 4, float> mCurrentVolume;
44 ::ll::TypedStorage<4, 4, float> mCurrentPitch;
45 // NOLINTEND
46
47public:
48 // prevent constructor by default
49 AmbientSoundController& operator=(AmbientSoundController const&);
50 AmbientSoundController(AmbientSoundController const&);
51 AmbientSoundController();
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 virtual ~AmbientSoundController() /*override*/ = default;
57
58 virtual void onWillChangeDimension(::Player& player) /*override*/;
59
60 virtual void onDimensionChanged(::Player& player) /*override*/;
61
62 virtual void onPlayerDestruction(::Player& player) /*override*/;
63 // NOLINTEND
64
65public:
66 // member functions
67 // NOLINTBEGIN
68 MCAPI AmbientSoundController(::WeakEntityRef localUser, ::SoundMapping const& soundMap);
69
70 MCAPI void _addDelayOrTransitioningToNewStage();
71
72 MCAPI void _startLoopSound();
73
74 MCAPI void _stopLoopSound(bool hard);
75
76 MCAPI void _tryPlayAdditionSounds(
77 ::Vec3 const& listenerPos,
78 ::brstd::function_ref<void(::HashedString const&, ::Vec3 const&)> const& playSoundFunc
79 );
80
81 MCAPI void _tryPlayLoopSounds(::Vec3 const& listenerPos);
82
83 MCAPI void _tryPlayMoodSound(
84 ::Vec3 const& listenerPos,
85 ::brstd::function_ref<void(::HashedString const&, ::Vec3 const&)> const& playSoundFunc,
86 ::brstd::function_ref<bool(::BrightnessPair, ::BlockPos const&, ::BrightnessPair)> lightThresholdFunc
87 );
88 // NOLINTEND
89
90public:
91 // constructor thunks
92 // NOLINTBEGIN
93 MCAPI void* $ctor(::WeakEntityRef localUser, ::SoundMapping const& soundMap);
94 // NOLINTEND
95
96public:
97 // virtual function thunks
98 // NOLINTBEGIN
99 MCAPI void $onWillChangeDimension(::Player& player);
100
101 MCFOLD void $onDimensionChanged(::Player& player);
102
103 MCAPI void $onPlayerDestruction(::Player& player);
104 // NOLINTEND
105};
Definition AmbientSoundController.h:5
Definition BlockPos.h:17
Definition PlayerListener.h:5
Definition Player.h:129
Definition SoundMapping.h:5
Definition Vec3.h:10
Definition BrightnessPair.h:8