LeviLamina
Loading...
Searching...
No Matches
ActorFactory.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/deps/game_refs/OwnerPtr.h"
8#include "mc/world/actor/ActorType.h"
9
10// auto generated forward declare list
11// clang-format off
12class Actor;
16class BlockPos;
17class CompoundTag;
18class DataLoadHelper;
20class EntityContext;
21class Experiments;
23class Level;
24class LevelChunk;
25class Vec2;
26class Vec3;
28struct ActorFactoryData;
29struct VanillaActorData;
30// clang-format on
31
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::Level>> mLevel;
37 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::IEntityInitializer>> mEntityInitializer;
38 ::ll::TypedStorage<8, 24, ::Bedrock::NonOwnerPointer<::ActorDefinitionGroup>> mDefinitions;
39 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::ActorFactoryData>> mFactoryFunctions;
40 ::ll::TypedStorage<8, 16, ::std::set<::std::string>> mExperimentalEntities;
41 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ActorComponentFactory>> mComponentFactory;
42 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ActorGoalFactory>> mGoalFactory;
43 // NOLINTEND
44
45public:
46 // virtual functions
47 // NOLINTBEGIN
48 // vIndex: 0
49 virtual ~ActorFactory();
50 // NOLINTEND
51
52public:
53 // member functions
54 // NOLINTBEGIN
55 MCAPI explicit ActorFactory(::Bedrock::NotNullNonOwnerPtr<::Level> level);
56
57 MCAPI void _buildSummonableActorList(
58 ::Experiments const& experiments,
59 ::std::function<void(::std::string const&, ::ActorFactoryData const&)> callback
60 ) const;
61
62 MCAPI ::OwnerPtr<::EntityContext> _constructActor(
63 ::ActorDefinitionIdentifier const& identifier,
64 ::Vec3 const& position,
65 ::Vec2 const& rotation,
66 ::std::vector<::std::string> const* previousDefinitions
67 ) const;
68
69 MCAPI void _loadDefinitionGroups(::ActorDefinitionGroup* group);
70
71 MCAPI void _loadDefinitionsHelper();
72
73 MCAPI bool _validateActorData(
74 ::CompoundTag& tag,
75 ::ActorDefinitionIdentifier& outDefinition,
76 ::Vec3& outPosition,
77 ::LevelChunk const* levelChunk
78 ) const;
79
80 MCAPI void applyEntityInitializer(::std::unique_ptr<::Actor> actor, ::EntityContext& entity) const;
81
82 MCAPI ::std::vector<::std::pair<::std::string, ::ActorDefinitionIdentifier const*>>
83 buildSummonEntityTypeEnum(::Experiments const& experiments) const;
84
85 MCAPI ::OwnerPtr<::EntityContext> clientCreateDisplayActor(
86 ::ActorDefinitionIdentifier const& identifier,
87 ::Actor* position,
88 ::Vec3 const& spawner,
89 ::Vec2 const& rotation
90 );
91
92 MCAPI ::OwnerPtr<::EntityContext> createActor(
93 ::std::string const& method,
94 ::ActorDefinitionIdentifier const& identifier,
95 ::Actor* spawner,
96 ::Vec3 const& position,
97 ::Vec2 const& rotation
98 );
99
100 MCAPI ::OwnerPtr<::EntityContext> createBornActor(::ActorDefinitionIdentifier const& identifier, ::Actor* parent);
101
102 MCAPI ::OwnerPtr<::EntityContext>
103 createBornActor(::ActorDefinitionIdentifier const& identifier, ::BlockPos const& pos);
104
105 MCAPI ::OwnerPtr<::EntityContext> createSpawnedActor(
106 ::ActorDefinitionIdentifier const& identifier,
107 ::Actor* spawner,
108 ::Vec3 const& position,
109 ::Vec2 const& rotation
110 );
111
112 MCAPI ::OwnerPtr<::EntityContext>
113 createTransformedActor(::ActorDefinitionIdentifier const& identifier, ::Actor* from);
114
115 MCAPI ::OwnerPtr<::EntityContext> loadActor(
116 ::CompoundTag* tag,
117 ::DataLoadHelper& dataLoadHelper,
118 ::DimensionHeightRange const& heightRange,
119 ::LevelChunk const* levelChunk
120 );
121
122 MCAPI ::ActorType lookupEntityType(::ActorDefinitionIdentifier const& identifier) const;
123 // NOLINTEND
124
125public:
126 // static functions
127 // NOLINTBEGIN
128 MCAPI static void fillFactoryData(
129 ::ActorDefinitionIdentifier const& identifier,
130 ::ActorDefinitionIdentifier const& baseIdentifier,
131 ::std::unordered_map<::std::string, ::ActorFactoryData> const& factoryFunctions,
133 );
134
135 MCAPI static void registerEntityMapping(
136 ::ActorType const& actorType,
137 bool allowSummon,
138 ::std::unique_ptr<
140 ::std::optional<int> experimentIndex
141 );
142 // NOLINTEND
143
144public:
145 // static variables
146 // NOLINTBEGIN
147 MCAPI static ::std::vector<::VanillaActorData>& builtinEntityMappings();
148 // NOLINTEND
149
150public:
151 // constructor thunks
152 // NOLINTBEGIN
153 MCAPI void* $ctor(::Bedrock::NotNullNonOwnerPtr<::Level> level);
154 // NOLINTEND
155
156public:
157 // destructor thunk
158 // NOLINTBEGIN
159 MCAPI void $dtor();
160 // NOLINTEND
161
162public:
163 // vftables
164 // NOLINTBEGIN
165 MCAPI static void** $vftable();
166 // NOLINTEND
167};
Definition ActorComponentFactory.h:13
Definition ActorDefinitionGroup.h:27
Definition ActorFactory.h:32
Definition ActorGoalFactory.h:8
Definition Actor.h:104
Definition BlockPos.h:18
Definition CompoundTag.h:13
Definition DataLoadHelper.h:20
Definition DimensionHeightRange.h:5
Definition EntityContext.h:16
Definition Experiments.h:14
Definition IEntityInitializer.h:11
Definition LevelChunk.h:73
Definition Level.h:234
Definition Vec2.h:5
Definition Vec3.h:10
Definition ActorDefinitionIdentifier.h:13
Definition ActorFactoryData.h:5
Definition VanillaActorData.h:5