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/actor/ActorDefinitionPtr.h"
15#include "mc/world/level/storage/Experiments.h"
16
17// auto generated forward declare list
18// clang-format off
20class ActorDefinition;
22class Level;
24class PackInstance;
25class PackLoadContext;
27class SemVersion;
28class SemVersionView;
29namespace Core { class Path; }
30namespace Json { class Value; }
31namespace Puv { class Input; }
32namespace SharedTypes::v1_26_10 { struct ActorDefinitions; }
33namespace SharedTypes::v1_26_10 { struct ActorDocument; }
34// clang-format on
35
36class ActorDefinitionGroup : public ::Bedrock::EnableNonOwnerReferences {
37public:
38 // ActorDefinitionGroup inner types declare
39 // clang-format off
40 struct EDLWrapper;
41 struct LoadActorResult;
42 // clang-format on
43
44 // ActorDefinitionGroup inner types define
45 enum class LoadStatus : int {
46 Success = 0,
47 FailedToParseIdentifier = 1,
48 InvalidNamespaceInIdentifier = 2,
49 DefinitionAlreadyDefined = 3,
50 FailedToLoadFromJSON = 4,
51 InvalidIdentifier = 5,
52 };
53
54 struct EDLWrapper {
55 public:
56 // member variables
57 // NOLINTBEGIN
58 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mList;
59 // NOLINTEND
60 };
61
63 public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<4, 4, ::ActorDefinitionGroup::LoadStatus> mLoadStatus;
67 ::ll::TypedStorage<8, 32, ::std::string> mActorId;
68 ::ll::TypedStorage<1, 1, bool> mIsVanillaOverride;
69 ::ll::TypedStorage<8, 32, ::PuvLoadData::LoadResultWithTiming> mLoadTime;
70 // NOLINTEND
71
72 public:
73 // member functions
74 // NOLINTBEGIN
75 MCAPI ~LoadActorResult();
76 // NOLINTEND
77
78 public:
79 // destructor thunk
80 // NOLINTBEGIN
81 MCFOLD void $dtor();
82 // NOLINTEND
83 };
84
85 using ActorDefinitionList = ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>;
86
87public:
88 // member variables
89 // NOLINTBEGIN
90 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorDefinitionPtr*>> mRegisteredPtrs;
91 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mDefinitions;
92 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ActorDefinitionGroup::EDLWrapper>> mTemplateMap;
93 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mResourcePackManager;
94 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator>> mLinkedAssetValidator;
95 ::ll::TypedStorage<8, 80, ::Bedrock::Threading::Mutex> mReferenceMutex;
96 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
97 ::ll::TypedStorage<8, 8, ::ActorComponentFactory*> mComponentFactory;
98 ::ll::TypedStorage<8, 72, ::Experiments> mExperiments;
99 // NOLINTEND
100
101public:
102 // prevent constructor by default
103 ActorDefinitionGroup& operator=(ActorDefinitionGroup const&);
104 ActorDefinitionGroup(ActorDefinitionGroup const&);
105 ActorDefinitionGroup();
106
107public:
108 // virtual functions
109 // NOLINTBEGIN
110 virtual ~ActorDefinitionGroup() /*override*/;
111 // NOLINTEND
112
113public:
114 // member functions
115 // NOLINTBEGIN
116 MCAPI ActorDefinitionGroup(
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_26_10::ActorDocument> _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 ::ActorDefinitionParseStatus _loadTemplates(
147 ::Level& level,
148 ::std::string const& base,
149 ::std::unordered_map<::std::string, ::SharedTypes::v1_26_10::ActorDefinitions>& componentsGroup,
150 ::SemVersion const& formatVersion,
151 ::PackLoadContext const& packLoadContext,
152 ::JsonBetaState useBetaFeatures
153 );
154
155 MCAPI bool _parseEntityJsonFromActorDocument(
157 ::std::unique_ptr<::ActorDefinition>& def,
158 ::SemVersion const& formatVersion,
159 ::PackLoadContext& packLoadContext,
160 ::std::string const& relativeResourceFilepath,
161 ::JsonBetaState useBetaFeatures,
162 ::std::string const& identifier,
163 ::Level& level,
164 ::LogArea logArea
165 );
166
167 MCAPI void _removeRef(::ActorDefinitionPtr& ptr);
168
169 MCAPI void _setupCommonResourceDefinitionMap(::ActorDefinition& def, ::Level& level);
170
171 MCAPI void _setupPropertyGroups(::Level& level, ::ActorDefinition const& def);
172
173 MCAPI ::std::vector<::std::string> buildActorEventList() const;
174
175 MCAPI ::ActorDefinitionPtr tryGetDefinition(::std::string const& definitionId);
176
177 MCAPI ::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const& base, ::std::string const& definitionId);
178 // NOLINTEND
179
180public:
181 // static functions
182 // NOLINTBEGIN
183 MCAPI static bool loadActorDefinitionIdentifier(
184 ::Json::Value const& root,
185 ::SemVersion const& formatVersion,
186 ::std::string& identifier
187 );
188
189 MCAPI static bool loadActorDefinitionRuntimeIdentifier(
190 ::Json::Value const& root,
191 ::SemVersionView const& formatVersion,
192 ::std::string& runtimeIdentifier
193 );
194
195 MCAPI static bool
196 tryReadEntityResourceFile(::PackInstance& packInstance, ::Core::Path const& resource, ::Json::Value& outputRoot);
197 // NOLINTEND
198
199public:
200 // constructor thunks
201 // NOLINTBEGIN
202 MCAPI void* $ctor(
203 ::Level& level,
204 ::ResourcePackManager& resourcePackManager,
205 ::IMinecraftEventing& eventing,
206 ::Experiments const& experiments,
208 );
209 // NOLINTEND
210
211public:
212 // destructor thunk
213 // NOLINTBEGIN
214 MCAPI void $dtor();
215 // NOLINTEND
216
217public:
218 // vftables
219 // NOLINTBEGIN
220 MCAPI static void** $vftable();
221 // NOLINTEND
222};
Definition ActorComponentFactory.h:13
Definition ActorDefinitionPtr.h:11
Definition ActorDefinition.h:81
Definition EnableNonOwnerReferences.h:7
static MCAPI void ** $vftable()
Definition NonOwnerPointer.h:9
Definition Path.h:17
Definition Experiments.h:14
Definition IMinecraftEventing.h:134
Definition Value.h:16
Definition Level.h:250
Definition LinkedAssetValidator.h:8
Definition PackInstance.h:17
Definition PackLoadContext.h:20
Definition Input.h:15
Definition ResourcePackManager.h:30
Definition SemVersionView.h:8
Definition SemVersion.h:15
Definition ActorDefinitionGroup.h:54
Definition ActorDefinitionGroup.h:62
Definition ActorDefinitions.h:15
Definition ActorDocument.h:17