Skip to content
LeviMC
English
AutoLightDark
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/puv_load_data/LoadResultWithTiming.h"
10#include "mc/world/actor/ActorDefinitionPtr.h"
11#include "mc/world/level/storage/Experiments.h"
12
13// auto generated forward declare list
14// clang-format off
16class ActorDefinition;
18class Level;
20class PackLoadContext;
22class SemVersion;
23namespace Json { class Value; }
24// clang-format on
25
26class ActorDefinitionGroup : public ::Bedrock::EnableNonOwnerReferences {
27public:
28 // ActorDefinitionGroup inner types declare
29 // clang-format off
30 struct EDLWrapper;
31 struct LoadActorResult;
32 // clang-format on
33
34 // ActorDefinitionGroup inner types define
35 enum class LoadStatus : int {
36 Success = 0,
37 FailedToParseIdentifier = 1,
38 InvalidNamespaceInIdentifier = 2,
39 DefinitionAlreadyDefined = 3,
40 FailedToLoadFromJSON = 4,
41 InvalidIdentifier = 5,
42 };
43
44 struct EDLWrapper {
45 public:
46 // member variables
47 // NOLINTBEGIN
48 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mList;
49 // NOLINTEND
50 };
51
53 public:
54 // member variables
55 // NOLINTBEGIN
56 ::ll::TypedStorage<4, 4, ::ActorDefinitionGroup::LoadStatus> mLoadStatus;
57 ::ll::TypedStorage<8, 32, ::std::string> mActorId;
58 ::ll::TypedStorage<1, 1, bool> mIsVanillaOverride;
59 ::ll::TypedStorage<8, 32, ::PuvLoadData::LoadResultWithTiming> mLoadTime;
60 // NOLINTEND
61 };
62
63public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 64, ::std::unordered_set<::ActorDefinitionPtr*>> mRegisteredPtrs;
67 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ActorDefinition>>> mDefinitions;
68 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ActorDefinitionGroup::EDLWrapper>> mTemplateMap;
69 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mResourcePackManager;
70 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator>> mLinkedAssetValidator;
71 ::ll::TypedStorage<8, 80, ::std::mutex> mReferenceMutex;
72 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
73 ::ll::TypedStorage<8, 8, ::ActorComponentFactory*> mComponentFactory;
74 ::ll::TypedStorage<8, 72, ::Experiments> mExperiments;
75 // NOLINTEND
76
77public:
78 // prevent constructor by default
79 ActorDefinitionGroup& operator=(ActorDefinitionGroup const&);
80 ActorDefinitionGroup(ActorDefinitionGroup const&);
81 ActorDefinitionGroup();
82
83public:
84 // virtual functions
85 // NOLINTBEGIN
86 virtual ~ActorDefinitionGroup() /*override*/ = default;
87 // NOLINTEND
88
89public:
90 // member functions
91 // NOLINTBEGIN
93 ::Level& level,
94 ::ResourcePackManager& resourcePackManager,
95 ::IMinecraftEventing& eventing,
96 ::Experiments const& experiments,
98 );
99
100 MCAPI ::ActorDefinitionGroup::LoadActorResult _loadActorDefinition(
101 ::Level& level,
102 ::PackLoadContext& packLoadContext,
103 ::std::string const& relativeResourceFilepath,
104 ::Json::Value& root,
105 ::std::unordered_set<::std::string>& definitions,
106 ::LogArea logArea
107 );
108
109 MCNAPI ::std::vector<::std::string> buildActorEventList() const;
110
111 MCAPI ::ActorDefinitionPtr tryGetDefinition(::std::string const& definitionId);
112
113 MCNAPI ::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const& base, ::std::string const& definitionId);
114 // NOLINTEND
115
116public:
117 // static functions
118 // NOLINTBEGIN
120
121#ifdef LL_PLAT_C
122 MCNAPI static void loadActorDefinitionFormatVersion(::Json::Value& root, ::SemVersion& formatVersion);
123
124 MCNAPI static bool loadActorDefinitionIdentifier(
125 ::Json::Value const& root,
126 ::SemVersion const& formatVersion,
127 ::std::string& identifier
128 );
129#endif
130 // NOLINTEND
131
132public:
133 // constructor thunks
134 // NOLINTBEGIN
135 MCNAPI void* $ctor(
136 ::Level& level,
137 ::ResourcePackManager& resourcePackManager,
138 ::IMinecraftEventing& eventing,
139 ::Experiments const& experiments,
141 );
142 // NOLINTEND
143};
Definition ActorComponentFactory.h:13
MCAPI ActorDefinitionGroup(::Level &level, ::ResourcePackManager &resourcePackManager, ::IMinecraftEventing &eventing, ::Experiments const &experiments, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator > linkedAssetValidator)
MCAPI::ActorDefinitionPtr tryGetDefinitionGroup(::std::string const &base, ::std::string const &definitionId)
MCAPI void * $ctor(::Level &level, ::ResourcePackManager &resourcePackManager, ::IMinecraftEventing &eventing, ::Experiments const &experiments, ::Bedrock::NonOwnerPointer<::LinkedAssetValidator > linkedAssetValidator)
static MCAPI void _setupCommonResourceDefinitionMap(::ActorDefinition &def, ::Level &level)
MCAPI ::std::vector<::std::string > buildActorEventList() const
Definition ActorDefinition.h:80
Definition EnableNonOwnerReferences.h:7
Definition NonOwnerPointer.h:9
Definition Experiments.h:14
Definition IMinecraftEventing.h:152
Definition Value.h:16
Definition Level.h:255
Definition LinkedAssetValidator.h:9
Definition PackLoadContext.h:20
Definition ResourcePackManager.h:29
Definition SemVersion.h:15
Definition ActorDefinitionGroup.h:44
Definition ActorDefinitionGroup.h:52