Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
EntitySystems.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
7#include "mc/deps/core/utility/typeid_t.h"
8#include "mc/deps/ecs/systems/IEntitySystems.h"
9#include "mc/deps/game_refs/OwnerPtr.h"
10#include "mc/deps/profiler/PredeclaredAnnotation.h"
11
12// auto generated forward declare list
13// clang-format off
15class EntityRegistry;
16class ITickingSystem;
20struct SystemCategory;
21struct SystemInfo;
22struct TickingSystemId;
23namespace VariableTickRateSystem { struct VariableTickController; }
24// clang-format on
25
26class EntitySystems : public ::IEntitySystems, public ::Bedrock::EnableNonOwnerReferences {
27public:
28 // EntitySystems inner types declare
29 // clang-format off
31 struct GameSystemCategory;
32 struct RuntimeInitialize;
35 // clang-format on
36
37 // EntitySystems inner types define
39
41
43
45
47
48 using MovementSystemCategory = ::entt::
49 type_list<::EntitySystems::UsedInServerPlayerMovement, ::EntitySystems::UsedInClientMovementCorrections>;
50
51 using SystemInvokeCallbackFunc = ::std::function<void(::TickingSystemId)>;
52
53 using SystemInvokeCallbackPair =
54 ::std::pair<::std::function<void(::TickingSystemId)>, ::std::function<void(::TickingSystemId)>>;
55
56 using SystemInvokeCallbackSig = void(::TickingSystemId);
57
58 using TotalTickCallbackFunc = ::std::function<void()>;
59
60 using TotalTickCallbackPair = ::std::pair<::std::function<void()>, ::std::function<void()>>;
61
62 using TotalTickCallbackSig = void();
63
64public:
65 // member variables
66 // NOLINTBEGIN
67 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PlayerInteractionSystem>> mPlayerInteractionSystem;
68 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::IEntitySystemsCollection>> mSystems;
69 ::ll::TypedStorage<8, 16, ::OwnerPtr<::EcsEventDispatcher>> mDispatcher;
70 ::ll::TypedStorage<8, 32, ::std::string> mName;
71 ::ll::TypedStorage<1, 1, bool> mEnableTimingCapture;
72 ::ll::TypedStorage<8, 64, ::std::function<void()>> mPreTotalTick;
73 ::ll::TypedStorage<8, 64, ::std::function<void()>> mPostTotalTick;
74 ::ll::TypedStorage<8, 64, ::std::function<void(::TickingSystemId)>> mPreSystemInvoke;
75 ::ll::TypedStorage<8, 64, ::std::function<void(::TickingSystemId)>> mPostSystemInvoke;
76 ::ll::TypedStorage<8, 8, ::Bedrock::Profiler::details::PredeclaredAnnotation> mTickingAnnotation;
77 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VariableTickRateSystem::VariableTickController>> mVariableTick;
78 // NOLINTEND
79
80public:
81 // prevent constructor by default
82 EntitySystems();
83
84public:
85 // virtual functions
86 // NOLINTBEGIN
87 virtual ~EntitySystems() /*override*/ = default;
88
89 virtual void tickMovementCatchup(::EntityRegistry& registry) /*override*/;
90
91 virtual void tickMovementCorrectionReplay(::EntityRegistry& registry) /*override*/;
92
93 virtual void registerTickingSystem(
94 ::gsl::span<::Bedrock::typeid_t<::SystemCategory> const> categories,
95 ::std::unique_ptr<::ITickingSystem> system,
96 ::SystemInfo const& info,
98 ) /*override*/;
99
100 virtual bool _hasSingleTickCategory(::Bedrock::typeid_t<::SystemCategory> const category) const /*override*/;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
107 ::std::unique_ptr<::IEntitySystemsCollection> systems,
108 ::std::string_view name,
109 bool useVariableTicks
110 );
111
112 MCNAPI void realTick(::EntityRegistry& registry);
113
114 MCNAPI void registerEvents(::EntityRegistry& registry);
115
116#ifdef LL_PLAT_C
117 MCNAPI ::std::pair<::std::function<void(::TickingSystemId)>, ::std::function<void(::TickingSystemId)>>
118 setSystemInvokeCallbacks(
119 ::std::function<void(::TickingSystemId)>&& preInvoke,
120 ::std::function<void(::TickingSystemId)>&& postInvoke
121 );
122
123 MCNAPI ::std::pair<::std::function<void()>, ::std::function<void()>>
124 setTotalTickCallbacks(::std::function<void()>&& preTick, ::std::function<void()>&& postTick);
125#endif
126
127 MCAPI void tick(::EntityRegistry& registry);
128
129 MCNAPI void tickEditor(::EntityRegistry& registry);
130
131 MCNAPI void tickInitialize(::EntityRegistry& registry);
132 // NOLINTEND
133
134public:
135 // constructor thunks
136 // NOLINTBEGIN
137 MCNAPI void*
138 $ctor(::std::unique_ptr<::IEntitySystemsCollection> systems, ::std::string_view name, bool useVariableTicks);
139 // NOLINTEND
140
141public:
142 // virtual function thunks
143 // NOLINTBEGIN
145
147
148 MCAPI void $registerTickingSystem(
149 ::gsl::span<::Bedrock::typeid_t<::SystemCategory> const> categories,
150 ::std::unique_ptr<::ITickingSystem> system,
151 ::SystemInfo const& info,
152 ::EntitySystemTickingMode tickingMode
153 );
154
156
157
158 // NOLINTEND
159};
Definition EnableNonOwnerReferences.h:7
Definition typeid_t.h:36
Definition EcsEventDispatcher.h:23
Definition EntityRegistry.h:10
MCAPI void registerEvents(::EntityRegistry &registry)
MCAPI void realTick(::EntityRegistry &registry)
MCAPI bool $_hasSingleTickCategory(::Bedrock::typeid_t<::SystemCategory > const category) const
MCAPI void $tickMovementCorrectionReplay(::EntityRegistry &registry)
MCAPI void * $ctor(::std::unique_ptr<::IEntitySystemsCollection > systems, ::std::string_view name, bool useVariableTicks)
MCAPI EntitySystems(::std::unique_ptr<::IEntitySystemsCollection > systems, ::std::string_view name, bool useVariableTicks)
MCAPI void tickEditor(::EntityRegistry &registry)
MCAPI void tickInitialize(::EntityRegistry &registry)
MCAPI void $tickMovementCatchup(::EntityRegistry &registry)
Definition IEntitySystems.h:17
Definition ITickingSystem.h:15
Definition PlayerInteractionSystem.h:15
Definition EntitySystemTickingMode.h:5
Definition EntitySystems.h:38
Definition EntitySystems.h:40
Definition EntitySystems.h:42
Definition EntitySystems.h:46
Definition IEntitySystemsCollection.h:21
Definition SystemCategory.h:5
Definition SystemInfo.h:14
Definition TickingSystemId.h:5
Definition VariableTickController.h:7