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/resources/JsonBetaState.h"
9#include "mc/world/actor/ActorDefinitionParseStatus.h"
10
11// auto generated forward declare list
12// clang-format off
13class ActorDefinition;
15class Experiments;
18class Level;
19class PackInstance;
21class SemVersion;
23namespace Core { class Path; }
24namespace Json { class Value; }
25// clang-format on
26
28public:
29 // ActorDefinitionGroup inner types declare
30 // clang-format off
31 struct EDLWrapper;
32 struct LoadActorResult;
33 // clang-format on
34
35 // ActorDefinitionGroup inner types define
36 struct EDLWrapper {
37 public:
38 // member variables
39 // NOLINTBEGIN
41 // NOLINTEND
42
43 public:
44 // prevent constructor by default
45 EDLWrapper& operator=(EDLWrapper const&);
46 EDLWrapper(EDLWrapper const&);
47 EDLWrapper();
48 };
49
50 enum class LoadStatus : int {
51 Success = 0,
52 FailedToParseIdentifier = 1,
53 InvalidNamespaceInIdentifier = 2,
54 DefinitionAlreadyDefined = 3,
55 FailedToLoadFromJSON = 4,
56 InvalidIdentifier = 5,
57 };
58
60 public:
61 // member variables
62 // NOLINTBEGIN
66 // NOLINTEND
67
68 public:
69 // prevent constructor by default
70 LoadActorResult& operator=(LoadActorResult const&);
73
74 public:
75 // member functions
76 // NOLINTBEGIN
77 MCAPI ~LoadActorResult();
78 // NOLINTEND
79
80 public:
81 // destructor thunk
82 // NOLINTBEGIN
83 MCFOLD void $dtor();
84 // NOLINTEND
85 };
86
87public:
88 // member variables
89 // NOLINTBEGIN
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
121 );
122
123 MCAPI void _getResources(::Level& level);
124
125 MCAPI ::ActorDefinitionGroup::LoadActorResult _loadActorDefinition(
126 ::Level& level,
127 ::IPackLoadContext& packLoadContext,
128 ::std::string const& relativeResourceFilepath,
129 ::Json::Value& root,
130 ::std::unordered_set<::std::string>& definitions,
131 ::LogArea logArea
132 );
133
134 MCAPI bool _loadDefinitionFromJSON(
135 ::SemVersion const& formatVersion,
136 ::IPackLoadContext& packLoadContext,
137 ::std::string const& relativeResourceFilepath,
138 ::Json::Value& minecraftEntityNode,
139 ::JsonBetaState useBetaFeatures,
140 ::std::string const& identifier,
141 ::Level& level,
142 ::LogArea logArea
143 );
144
145 MCAPI ::ActorDefinitionParseStatus
146 _loadTemplates(::Level& level, ::std::string const& base, ::DeserializeDataParams deserializeDataParams);
147
148 MCAPI void _removeRef(::ActorDefinitionPtr& ptr);
149
150 MCAPI void _setupCommonResourceDefinitionMap(::ActorDefinition& def, ::Level& level);
151
152 MCAPI void _setupPropertyGroups(::Level& level, ::ActorDefinition const& def);
153
154 MCAPI ::std::vector<::std::string> buildActorEventList() const;
155
156 MCAPI ::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const& base, ::std::string const& definitionId);
157 // NOLINTEND
158
159public:
160 // static functions
161 // NOLINTBEGIN
162 MCAPI static void forEachComponentOf(
163 ::Json::Value& entityValue,
164 ::std::string const& componentName,
165 ::std::function<void(::Json::Value&, ::Json::Value&)> const& callback
166 );
167
168 MCAPI static void loadActorDefinitionFormatVersion(::Json::Value const& root, ::SemVersion& formatVersion);
169
170 MCAPI static bool loadActorDefinitionIdentifier(
171 ::Json::Value const& root,
172 ::SemVersion const& formatVersion,
173 ::std::string& identifier
174 );
175
176 MCAPI static bool loadActorDefinitionRuntimeIdentifier(
177 ::Json::Value const& root,
178 ::SemVersion const& formatVersion,
179 ::std::string& runtimeIdentifier
180 );
181
182 MCAPI static bool
183 tryReadEntityResourceFile(::PackInstance& packInstance, ::Core::Path const& resource, ::Json::Value& outputRoot);
184 // NOLINTEND
185
186public:
187 // constructor thunks
188 // NOLINTBEGIN
189 MCAPI void* $ctor(
190 ::Level& level,
191 ::ResourcePackManager& resourcePackManager,
192 ::IMinecraftEventing& eventing,
193 ::Experiments const& experiments
194 );
195 // NOLINTEND
196
197public:
198 // destructor thunk
199 // NOLINTBEGIN
200 MCAPI void $dtor();
201 // NOLINTEND
202
203public:
204 // vftables
205 // NOLINTBEGIN
206 MCAPI static void** $vftable();
207 // NOLINTEND
208};
Definition ActorDefinitionGroup.h:27
Definition ActorDefinitionPtr.h:11
Definition ActorDefinition.h:21
Definition EnableNonOwnerReferences.h:7
Definition Path.h:15
Definition Experiments.h:14
Definition IMinecraftEventing.h:143
Definition IPackLoadContext.h:17
Definition Value.h:16
Definition Level.h:234
Definition PackInstance.h:23
Definition Path.h:16
Definition ResourcePackManager.h:24
Definition SemVersion.h:15
Definition ActorDefinitionGroup.h:36
Definition ActorDefinitionGroup.h:59
Definition DeserializeDataParams.h:15
Definition Alias.h:14