LeviLamina
Loading...
Searching...
No Matches
FunctionManager.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/server/commands/CurrentCmdVersion.h"
7#include "mc/server/commands/functions/FunctionQueueOrder.h"
8
9// auto generated forward declare list
10// clang-format off
11class CommandOrigin;
12class CommandRegistry;
13class FunctionEntry;
14class GameRule;
16class IFunctionEntry;
18namespace Core { class Path; }
19namespace Json { class Value; }
20// clang-format on
21
22class FunctionManager {
23public:
24 // FunctionManager inner types declare
25 // clang-format off
26 struct OriginMapping;
27 struct QueuedCommand;
28 struct TickFunction;
29 // clang-format on
30
31 // FunctionManager inner types define
32 struct OriginMapping {
33 public:
34 // member variables
35 // NOLINTBEGIN
38 // NOLINTEND
39
40 public:
41 // prevent constructor by default
42 OriginMapping& operator=(OriginMapping const&);
43 OriginMapping(OriginMapping const&);
44 OriginMapping();
45
46 public:
47 // member functions
48 // NOLINTBEGIN
50 // NOLINTEND
51
52 public:
53 // destructor thunk
54 // NOLINTBEGIN
55 MCNAPI void $dtor();
56 // NOLINTEND
57 };
58
59 struct QueuedCommand {
60 public:
61 // member variables
62 // NOLINTBEGIN
65 // NOLINTEND
66
67 public:
68 // prevent constructor by default
69 QueuedCommand& operator=(QueuedCommand const&);
70 QueuedCommand(QueuedCommand const&);
71 QueuedCommand();
72 };
73
74 struct TickFunction {
75 public:
76 // member variables
77 // NOLINTBEGIN
80 // NOLINTEND
81
82 public:
83 // prevent constructor by default
84 TickFunction& operator=(TickFunction const&);
85 TickFunction(TickFunction const&);
86 TickFunction();
87 };
88
89public:
90 // member variables
91 // NOLINTBEGIN
92 ::ll::TypedStorage<8, 8, ::GameRule const*> mGameRule;
93 ::ll::TypedStorage<1, 1, bool> mIsProcessingStack;
94 ::ll::TypedStorage<8, 8, uint64> mInsertPoint;
95 ::ll::TypedStorage<4, 4, int> mExecutionCount;
96 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::QueuedCommand>> mCommandList;
97 ::ll::TypedStorage<8, 64, ::std::unordered_map<::CommandOrigin const*, ::FunctionManager::OriginMapping>>
98 mOriginMap;
99 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ICommandDispatcher>> mCommandDispatcher;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOrigin>> mTickOrigin;
101 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::FunctionEntry>>> mFunctions;
102 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::TickFunction>> mTickFunctions;
103 // NOLINTEND
104
105public:
106 // prevent constructor by default
107 FunctionManager();
108
109public:
110 // virtual functions
111 // NOLINTBEGIN
112 virtual ~FunctionManager();
113 // NOLINTEND
114
115public:
116 // member functions
117 // NOLINTBEGIN
119 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
120 ::std::unique_ptr<::CommandOrigin> tickOrigin,
121 ::GameRule const* gameRule
122 );
123
124 MCNAPI ::CommandOrigin const& _addOriginReference(::CommandOrigin const& origin, uint amount);
125
126 MCNAPI void _addTickFunctionsFromJson(::Json::Value const& arrayVal, ::CurrentCmdVersion resourceCommandVersion);
127
128 MCNAPI void _loadTickFiles(::ResourcePackManager const& serverPackManager);
129
131 ::std::string const& functionName,
132 ::std::vector<::std::string> const& lines,
133 ::std::vector<::std::string>& errorList,
134 ::CurrentCmdVersion commandVersion,
135 ::CommandRegistry const& registry
136 );
137
139 ::std::vector<::std::unique_ptr<::IFunctionEntry>> const& toQueue,
140 ::CommandOrigin const& origin
141 );
142
143 MCNAPI void _removeOriginReference(::CommandOrigin const& origin, uint amount);
144
145 MCNAPI int execute(::FunctionEntry& toExecute, ::CommandOrigin const& origin, ::FunctionQueueOrder order);
146
147 MCNAPI ::FunctionEntry* getFunction(::std::string const& functionName);
148
149 MCNAPI void load(::ResourcePackManager& serverPackManager, ::CommandRegistry& registry);
150
151 MCNAPI void tick();
152 // NOLINTEND
153
154public:
155 // static functions
156 // NOLINTBEGIN
157 MCNAPI static ::std::string getFunctionNameFromPath(::Core::Path const& filename);
158 // NOLINTEND
159
160public:
161 // constructor thunks
162 // NOLINTBEGIN
163 MCNAPI void* $ctor(
164 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
165 ::std::unique_ptr<::CommandOrigin> tickOrigin,
166 ::GameRule const* gameRule
167 );
168 // NOLINTEND
169
170public:
171 // destructor thunk
172 // NOLINTBEGIN
173 MCNAPI void $dtor();
174 // NOLINTEND
175
176public:
177 // vftables
178 // NOLINTBEGIN
179 MCNAPI static void** $vftable();
180 // NOLINTEND
181};
Definition CommandOrigin.h:32
Definition CommandRegistry.h:47
Definition Path.h:10
Definition FunctionEntry.h:15
static MCAPI void ** $vftable()
MCAPI void _addTickFunctionsFromJson(::Json::Value const &arrayVal, ::CurrentCmdVersion resourceCommandVersion)
MCAPI::FunctionEntry * getFunction(::std::string const &functionName)
MCAPI void _removeOriginReference(::CommandOrigin const &origin, uint amount)
MCAPI void load(::ResourcePackManager &serverPackManager, ::CommandRegistry &registry)
MCAPI int execute(::FunctionEntry &toExecute, ::CommandOrigin const &origin, ::FunctionQueueOrder order)
MCAPI void * $ctor(::std::unique_ptr<::ICommandDispatcher > commandDispatcher, ::std::unique_ptr<::CommandOrigin > tickOrigin, ::GameRule const *gameRule)
MCAPI void _queueCommandsAfterCaller(::std::vector<::std::unique_ptr<::IFunctionEntry > > const &toQueue, ::CommandOrigin const &origin)
MCAPI void $dtor()
static MCAPI ::std::string getFunctionNameFromPath(::Core::Path const &filename)
MCAPI void _processFunctionEntry(::std::string const &functionName, ::std::vector<::std::string > const &lines, ::std::vector<::std::string > &errorList, ::CurrentCmdVersion commandVersion, ::CommandRegistry const &registry)
MCAPI FunctionManager(::std::unique_ptr<::ICommandDispatcher > commandDispatcher, ::std::unique_ptr<::CommandOrigin > tickOrigin, ::GameRule const *gameRule)
MCAPI void tick()
MCAPI::CommandOrigin const & _addOriginReference(::CommandOrigin const &origin, uint amount)
MCAPI void _loadTickFiles(::ResourcePackManager const &serverPackManager)
Definition GameRule.h:13
Definition ICommandDispatcher.h:11
Definition IFunctionEntry.h:14
Definition Value.h:16
Definition ResourcePackManager.h:29
Definition FunctionManager.h:32
Definition FunctionManager.h:59
Definition FunctionManager.h:74
Definition Alias.h:14