LeviLamina
Loading...
Searching...
No Matches
ActorDefinitionGroup.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/debug/log/LogArea.h"
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/deps/core/utility/NonOwnerPointer.h"
9#include "mc/deps/puv/LoadResult.h"
10#include "mc/deps/puv/puv_load_data/LoadResultWithTiming.h"
11#include "mc/platform/threading/Mutex.h"
12#include "mc/resources/JsonBetaState.h"
13#include "mc/world/actor/ActorDefinitionParseStatus.h"
14#include "mc/world/level/storage/Experiments.h"
15
16// auto generated forward declare list
17// clang-format off
19class ActorDefinition;
23class Level;
25class PackInstance;
27class SemVersion;
28namespace Core { class Path; }
29namespace Json { class Value; }
30namespace Puv { class Input; }
31namespace SharedTypes::v1_21_120 { struct ActorDefinitions; }
32namespace SharedTypes::v1_21_120 { struct ActorDocument; }
33// clang-format on
34
36public:
37 // ActorDefinitionGroup inner types declare
38 // clang-format off
39 struct EDLWrapper;
40 struct LoadActorResult;
41 // clang-format on
42
43 // ActorDefinitionGroup inner types define
44 using ActorDefinitionList = ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>;
45
46 struct EDLWrapper {
47 public:
48 // member variables
49 // NOLINTBEGIN
50 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mList;
51 // NOLINTEND
52 };
53
54 enum class LoadStatus : int {
55 Success = 0,
56 FailedToParseIdentifier = 1,
57 InvalidNamespaceInIdentifier = 2,
58 DefinitionAlreadyDefined = 3,
59 FailedToLoadFromJSON = 4,
60 InvalidIdentifier = 5,
61 };
62
64 public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<4, 4, ::ActorDefinitionGroup::LoadStatus> mLoadStatus;
68 ::ll::TypedStorage<8, 32, ::std::string> mActorId;
69 ::ll::TypedStorage<1, 1, bool> mIsVanillaOverride;
70 ::ll::TypedStorage<8, 32, ::PuvLoadData::LoadResultWithTiming> mLoadTime;
71 // NOLINTEND
72
73 public:
74 // member functions
75 // NOLINTBEGIN
76 MCAPI ~LoadActorResult();
77 // NOLINTEND
78
79 public:
80 // destructor thunk
81 // NOLINTBEGIN
82 MCFOLD void $dtor();
83 // NOLINTEND
84 };
85
86public:
87 // member variables
88 // NOLINTBEGIN
89 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorDefinitionPtr*>> mRegisteredPtrs;
90 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mDefinitions;
91 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ActorDefinitionGroup::EDLWrapper>> mTemplateMap;
92 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mResourcePackManager;
93 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator>> mLinkedAssetValidator;
94 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mReferenceMutex;
95 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
96 ::ll::TypedStorage<8, 8, ::ActorComponentFactory*> mComponentFactory;
97 ::ll::TypedStorage<8, 72, ::Experiments> mExperiments;
98 // NOLINTEND
99
100public:
101 // prevent constructor by default
105
106public:
107 // virtual functions
108 // NOLINTBEGIN
109 // vIndex: 0
110 virtual ~ActorDefinitionGroup() /*override*/;
111 // NOLINTEND
112
113public:
114 // member functions
115 // NOLINTBEGIN
117 ::Level& level,
118 ::ResourcePackManager& resourcePackManager,
119 ::IMinecraftEventing& eventing,
120 ::Experiments const& experiments,
122 );
123
124 MCAPI void _getResources(::Level& level);
125
126 MCAPI ::Puv::LoadResult<::SharedTypes::v1_21_120::ActorDocument> _initActorDefinition(
127 ::Puv::Input const& input,
128 ::SemVersion const& formatVersion,
129 ::IPackLoadContext& packLoadContext,
130 ::std::string const& relativeResourceFilepath,
131 ::JsonBetaState useBetaFeatures,
132 ::std::string const& identifier,
133 ::Level& level,
134 ::LogArea logArea
135 );
136
137 MCAPI ::ActorDefinitionGroup::LoadActorResult _loadActorDefinition(
138 ::Level& level,
139 ::IPackLoadContext& packLoadContext,
140 ::std::string const& relativeResourceFilepath,
141 ::Json::Value& root,
142 ::std::unordered_set<::std::string>& definitions,
143 ::LogArea logArea
144 );
145
146 MCAPI ::Puv::LoadResult<::SharedTypes::v1_21_120::ActorDocument> _loadDefinitionFromJSON(
147 ::SemVersion const& formatVersion,
148 ::IPackLoadContext& packLoadContext,
149 ::std::string const& relativeResourceFilepath,
150 ::Json::Value minecraftEntityNode,
151 ::JsonBetaState useBetaFeatures,
152 ::std::string const& identifier,
153 ::Level& level,
154 ::LogArea logArea
155 );
156
157 MCAPI ::ActorDefinitionParseStatus _loadTemplates(
158 ::Level& level,
159 ::std::string const& base,
160 ::std::unordered_map<::std::string, ::SharedTypes::v1_21_120::ActorDefinitions>& componentsGroup,
161 ::SemVersion const& formatVersion,
162 ::IPackLoadContext const& packLoadContext,
163 ::JsonBetaState useBetaFeatures
164 );
165
166 MCAPI void _removeRef(::ActorDefinitionPtr& ptr);
167
168 MCAPI void _setupCommonResourceDefinitionMap(::ActorDefinition& def, ::Level& level);
169
170 MCAPI void _setupPropertyGroups(::Level& level, ::ActorDefinition const& def);
171
172 MCAPI ::std::vector<::std::string> buildActorEventList() const;
173
174 MCAPI ::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const& base, ::std::string const& definitionId);
175 // NOLINTEND
176
177public:
178 // static functions
179 // NOLINTBEGIN
180 MCAPI static void forEachComponentOf(
181 ::Json::Value& entityValue,
182 ::std::string const& componentName,
183 ::std::function<void(::Json::Value&, ::Json::Value&)> const& callback
184 );
185
186 MCAPI static bool loadActorDefinitionIdentifier(
187 ::Json::Value const& root,
188 ::SemVersion const& formatVersion,
189 ::std::string& identifier
190 );
191
192 MCAPI static bool loadActorDefinitionRuntimeIdentifier(
193 ::Json::Value const& root,
194 ::SemVersion const& formatVersion,
195 ::std::string& runtimeIdentifier
196 );
197
198 MCAPI static bool
199 tryReadEntityResourceFile(::PackInstance& packInstance, ::Core::Path const& resource, ::Json::Value& outputRoot);
200 // NOLINTEND
201
202public:
203 // constructor thunks
204 // NOLINTBEGIN
205 MCAPI void* $ctor(
206 ::Level& level,
207 ::ResourcePackManager& resourcePackManager,
208 ::IMinecraftEventing& eventing,
209 ::Experiments const& experiments,
211 );
212 // NOLINTEND
213
214public:
215 // destructor thunk
216 // NOLINTBEGIN
217 MCAPI void $dtor();
218 // NOLINTEND
219
220public:
221 // vftables
222 // NOLINTBEGIN
223 MCNAPI static void** $vftable();
224 // NOLINTEND
225};
Definition ActorComponentFactory.h:13
Definition ActorDefinitionGroup.h:35
static MCAPI void ** $vftable()
Definition ActorDefinitionPtr.h:11
Definition ActorDefinition.h:80
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
Definition Path.h:11
Definition Experiments.h:14
Definition IMinecraftEventing.h:149
Definition IPackLoadContext.h:20
Definition Value.h:16
Definition Level.h:247
Definition LinkedAssetValidator.h:8
Definition PackInstance.h:16
Definition Path.h:16
Definition Input.h:15
Definition ResourcePackManager.h:24
Definition SemVersion.h:16
Definition ActorDefinitionGroup.h:46
Definition ActorDefinitionGroup.h:63