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