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/LoadDataRefVariant.h"
10#include "mc/deps/puv/LoadResultBetaVariant.h"
11#include "mc/deps/puv/puv_load_data/LoadResultWithTiming.h"
12#include "mc/platform/threading/Mutex.h"
13#include "mc/resources/JsonBetaState.h"
14#include "mc/world/actor/ActorDefinitionPtr.h"
15#include "mc/world/level/storage/Experiments.h"
16
17// auto generated forward declare list
18// clang-format off
20class ActorDefinition;
23class Level;
25class PackInstance;
26class PackLoadContext;
28class SemVersion;
29class SemVersionView;
30namespace Core { class Path; }
31namespace Json { class Value; }
32namespace Puv { class Input; }
33namespace SharedTypes::Beta { struct ActorDocument; }
34namespace SharedTypes::v1_26_20 { struct ActorDocument; }
35// clang-format on
36
37class ActorDefinitionGroup : public ::Bedrock::EnableNonOwnerReferences {
38public:
39 // ActorDefinitionGroup inner types declare
40 // clang-format off
41 struct EDLWrapper;
42 struct LoadActorResult;
43 // clang-format on
44
45 // ActorDefinitionGroup inner types define
46 enum class LoadStatus : int {
47 Success = 0,
48 FailedToParseIdentifier = 1,
49 InvalidNamespaceInIdentifier = 2,
50 DefinitionAlreadyDefined = 3,
51 FailedToLoadFromJSON = 4,
52 InvalidIdentifier = 5,
53 };
54
55 struct EDLWrapper {
56 public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mList;
60 // NOLINTEND
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
102 ActorDefinitionGroup& operator=(ActorDefinitionGroup const&);
103 ActorDefinitionGroup(ActorDefinitionGroup const&);
104 ActorDefinitionGroup();
105
106public:
107 // virtual functions
108 // NOLINTBEGIN
109 virtual ~ActorDefinitionGroup() /*override*/;
110 // NOLINTEND
111
112public:
113 // member functions
114 // NOLINTBEGIN
115 MCAPI ActorDefinitionGroup(
116 ::Level& level,
117 ::ResourcePackManager& resourcePackManager,
118 ::IMinecraftEventing& eventing,
119 ::Experiments const& experiments,
121 );
122
123 MCAPI void _getResources(::Level& level);
124
125 MCAPI ::Puv::LoadResultBetaVariant<::SharedTypes::v1_26_20::ActorDocument, ::SharedTypes::Beta::ActorDocument>
126 _initActorDefinition(
127 ::Puv::Input const& input,
128 ::SemVersion const& formatVersion,
129 ::PackLoadContext& 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 ::PackLoadContext& 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::LoadResultBetaVariant<::SharedTypes::v1_26_20::ActorDocument, ::SharedTypes::Beta::ActorDocument>
147 _loadDefinitionFromJSON(
148 ::SemVersion const& formatVersion,
149 ::PackLoadContext& packLoadContext,
150 ::std::string const& relativeResourceFilepath,
151 ::Json::Value minecraftEntityNode,
152 ::JsonBetaState useBetaFeatures,
153 ::std::string const& identifier,
154 ::Level& level,
155 ::LogArea logArea
156 );
157
158 MCAPI ::Puv::LoadResultBetaVariant<::SharedTypes::v1_26_20::ActorDocument, ::SharedTypes::Beta::ActorDocument>
159 _loadEntityNode(
160 ::Puv::Input const& input,
161 ::SemVersion const& formatVersion,
162 ::PackLoadContext const& packLoadContext,
163 ::JsonBetaState useBetaFeatures,
165 ) const;
166
167 MCAPI bool _parseEntityJsonFromActorDocument(
169 actorDocumentRefVariant,
170 ::std::unique_ptr<::ActorDefinition>& def,
171 ::SemVersion const& formatVersion,
172 ::PackLoadContext& packLoadContext,
173 ::std::string const& relativeResourceFilepath,
174 ::JsonBetaState useBetaFeatures,
175 ::std::string const& identifier,
176 ::Level& level,
177 ::LogArea logArea
178 );
179
180 MCAPI void _setupCommonResourceDefinitionMap(::ActorDefinition& def, ::Level& level);
181
182 MCAPI void _setupPropertyGroups(::Level& level, ::ActorDefinition const& def);
183
184 MCAPI ::std::vector<::std::string> buildActorEventList() const;
185
186 MCAPI ::ActorDefinitionPtr tryGetDefinition(::std::string const& definitionId);
187
188 MCAPI ::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const& base, ::std::string const& definitionId);
189 // NOLINTEND
190
191public:
192 // static functions
193 // NOLINTBEGIN
194 MCAPI static void loadActorDefinitionFormatVersion(::Json::Value& root, ::SemVersion& formatVersion);
195
196 MCAPI static bool loadActorDefinitionIdentifier(
197 ::Json::Value const& root,
198 ::SemVersion const& formatVersion,
199 ::std::string& identifier
200 );
201
202 MCAPI static bool loadActorDefinitionRuntimeIdentifier(
203 ::Json::Value const& root,
204 ::SemVersionView const& formatVersion,
205 ::std::string& runtimeIdentifier
206 );
207
208 MCAPI static bool
209 tryReadEntityResourceFile(::PackInstance& packInstance, ::Core::Path const& resource, ::Json::Value& outputRoot);
210 // NOLINTEND
211
212public:
213 // constructor thunks
214 // NOLINTBEGIN
215 MCAPI void* $ctor(
216 ::Level& level,
217 ::ResourcePackManager& resourcePackManager,
218 ::IMinecraftEventing& eventing,
219 ::Experiments const& experiments,
221 );
222 // NOLINTEND
223
224public:
225 // destructor thunk
226 // NOLINTBEGIN
227 MCAPI void $dtor();
228 // NOLINTEND
229
230public:
231 // vftables
232 // NOLINTBEGIN
233 MCAPI static void** $vftable();
234 // NOLINTEND
235};
Definition ActorComponentFactory.h:13
Definition ActorDefinition.h:83
Definition ActorMigratedDefinitionFactory.h:42
Definition EnableNonOwnerReferences.h:7
static MCAPI void ** $vftable()
Definition NonOwnerPointer.h:9
Definition Path.h:12
Definition Experiments.h:14
Definition IMinecraftEventing.h:138
Definition Value.h:16
Definition Level.h:254
Definition LinkedAssetValidator.h:8
Definition PackInstance.h:28
Definition PackLoadContext.h:20
Definition Input.h:15
Definition LoadDataRefVariant.h:8
Definition ResourcePackManager.h:35
Definition SemVersionView.h:8
Definition SemVersion.h:15
Definition ActorDefinitionGroup.h:55
Definition ActorDefinitionGroup.h:63
Definition ActorDocument.h:17
Definition ActorDocument.h:18