3#include "mc/_HeaderOutputPredefine.h"
6#include "mc/client/sound/EventToSoundListMap.h"
7#include "mc/deps/core/string/HashedString.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/shared_types/legacy/LevelSoundEvent.h"
10#include "mc/platform/brstd/flat_map.h"
11#include "mc/util/molang/ExpressionNode.h"
19namespace Json {
class Value; }
37 using is_transparent = void;
44 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>> mBaseSounds;
50 ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>,
51 ::SoundMapping::SoundVariantCompare,
52 ::std::vector<::HashedString>,
53 ::std::vector<::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>>>>
55 ::ll::TypedStorage<8, 16, ::ExpressionNode> mVariantKey;
63 ::ll::TypedStorage<8, 80, ::EventToSoundListMap> mBaseSounds;
69 ::EventToSoundListMap,
70 ::SoundMapping::SoundVariantCompare,
71 ::std::vector<::HashedString>,
72 ::std::vector<::EventToSoundListMap>>>
74 ::ll::TypedStorage<8, 16, ::ExpressionNode> mVariantKey;
82 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>> mSounds;
83 ::ll::TypedStorage<8, 32, ::std::string> mBaseBlock;
91 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::SoundMapping::BlockSounds>> mDefaultBlockSounds;
92 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::SoundMapping::EntitySoundList>>
97 using EventSoundMap = ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>;
99 using NamedSoundMap = ::std::unordered_map<::HashedString, ::Sound>;
104 ::ll::TypedStorage<8, 64, ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>> mEventSounds;
105 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::Sound>> mNamedSounds;
106 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::SoundMapping::EntitySounds>> mEntitySounds;
107 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::SoundMapping::BlockSounds>> mBlockSounds;
108 ::ll::TypedStorage<8, 128, ::SoundMapping::ActorInteractiveSounds> mEntityInteractiveSounds;
114 virtual ~SoundMapping() =
default;
120 MCAPI ::Sound
const& _getBlockSound(
121 ::std::unordered_map<::std::string, ::SoundMapping::BlockSounds>
const& blockSounds,
122 ::SharedTypes::Legacy::LevelSoundEvent eventType,
123 ::std::string
const& blockType
126 MCAPI
void _loadSounds(::Json::Value
const& json, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator> validator);
128 MCAPI ::Sound
const& getEntitySound(
129 ::SharedTypes::Legacy::LevelSoundEvent eventType,
130 ::ActorSoundIdentifier
const& actorSoundIdentifier
133 MCAPI ::Sound
const& getEventSound(::SharedTypes::Legacy::LevelSoundEvent eventType)
const;
135 MCAPI ::Sound
const& getNamedSound(::HashedString
const& name)
const;
137 MCAPI ::Sound getSound(
138 ::SharedTypes::Legacy::LevelSoundEvent eventType,
139 ::ActorSoundIdentifier
const& actorSoundIdentifier,
140 ::std::string
const& blockType,
148 MCAPI
static void _loadBlockSounds(
149 ::Json::Value
const& root,
150 ::std::unordered_map<::std::string, ::SoundMapping::BlockSounds>& blockSoundList
153 MCAPI
static void _loadEntityInteractiveSounds(
154 ::Json::Value
const& root,
155 ::std::unordered_map<::std::string, ::SoundMapping::BlockSounds>& blockSounds,
156 ::std::unordered_map<::std::string, ::SoundMapping::EntitySoundList>& entitySoundLists
159 MCAPI
static void _loadEventSounds(
160 ::Json::Value
const& root,
161 ::std::unordered_map<::SharedTypes::Legacy::LevelSoundEvent, ::Sound>& eventSoundMap,
Definition ActorSoundIdentifier.h:17
Definition LinkedAssetValidator.h:8
Definition SoundMapping.h:5
Definition SoundMapping.h:25
Definition SoundMapping.h:23
Definition SoundMapping.h:21
Definition SoundMapping.h:19
Definition SoundMapping.h:17