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/CommandOrigin.h"
7#include "mc/server/commands/CurrentCmdVersion.h"
8#include "mc/server/commands/functions/FunctionQueueOrder.h"
9
10// auto generated forward declare list
11// clang-format off
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
33 public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOrigin>> mOrigin;
37 ::ll::TypedStorage<4, 4, uint> mRefCount;
38 // NOLINTEND
39
40 public:
41 // member functions
42 // NOLINTBEGIN
43 MCAPI ~OriginMapping();
44 // NOLINTEND
45
46 public:
47 // destructor thunk
48 // NOLINTBEGIN
49 MCFOLD void $dtor();
50 // NOLINTEND
51 };
52
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 8, ::IFunctionEntry*> mFunction;
58 ::ll::TypedStorage<8, 8, ::gsl::not_null<::CommandOrigin const*>> mOrigin;
59 // NOLINTEND
60 };
61
62 struct TickFunction {
63 public:
64 // member variables
65 // NOLINTBEGIN
66 ::ll::TypedStorage<8, 8, ::gsl::not_null<::FunctionEntry*>> mFunction;
67 ::ll::TypedStorage<1, 1, ::FunctionQueueOrder> mOrder;
68 // NOLINTEND
69 };
70
71public:
72 // member variables
73 // NOLINTBEGIN
74 ::ll::TypedStorage<8, 8, ::GameRule const*> mGameRule;
75 ::ll::TypedStorage<1, 1, bool> mIsProcessingStack;
76 ::ll::TypedStorage<8, 8, uint64> mInsertPoint;
77 ::ll::TypedStorage<4, 4, int> mExecutionCount;
78 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::QueuedCommand>> mCommandList;
79 ::ll::TypedStorage<8, 64, ::std::unordered_map<::CommandOrigin const*, ::FunctionManager::OriginMapping>>
80 mOriginMap;
81 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ICommandDispatcher>> mCommandDispatcher;
82 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOrigin>> mTickOrigin;
83 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::FunctionEntry>>> mFunctions;
84 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::TickFunction>> mTickFunctions;
85 // NOLINTEND
86
87public:
88 // prevent constructor by default
89 FunctionManager();
90
91public:
92 // virtual functions
93 // NOLINTBEGIN
94 virtual ~FunctionManager();
95 // NOLINTEND
96
97public:
98 // member functions
99 // NOLINTBEGIN
100 MCAPI FunctionManager(
101 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
102 ::std::unique_ptr<::CommandOrigin> tickOrigin,
103 ::GameRule const* gameRule
104 );
105
106 MCAPI ::CommandOrigin const& _addOriginReference(::CommandOrigin const& origin, uint amount);
107
108 MCAPI void _addTickFunctionsFromJson(::Json::Value const& arrayVal, ::CurrentCmdVersion resourceCommandVersion);
109
110 MCAPI void _loadTickFiles(::ResourcePackManager const& serverPackManager);
111
112 MCAPI void _processFunctionEntry(
113 ::std::string const& functionName,
114 ::std::vector<::std::string> const& lines,
115 ::std::vector<::std::string>& errorList,
116 ::CurrentCmdVersion commandVersion,
117 ::CommandRegistry const& registry
118 );
119
120 MCAPI void _queueCommandsAfterCaller(
121 ::std::vector<::std::unique_ptr<::IFunctionEntry>> const& toQueue,
122 ::CommandOrigin const& origin
123 );
124
125 MCAPI void _removeOriginReference(::CommandOrigin const& origin, uint amount);
126
127 MCAPI int execute(::FunctionEntry& toExecute, ::CommandOrigin const& origin, ::FunctionQueueOrder order);
128
129 MCAPI ::FunctionEntry* getFunction(::std::string const& functionName);
130
131 MCAPI void load(::ResourcePackManager& serverPackManager, ::CommandRegistry& registry);
132
133 MCAPI void tick();
134 // NOLINTEND
135
136public:
137 // static functions
138 // NOLINTBEGIN
139 MCAPI static ::std::string getFunctionNameFromPath(::Core::Path const& filename);
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor(
146 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
147 ::std::unique_ptr<::CommandOrigin> tickOrigin,
148 ::GameRule const* gameRule
149 );
150 // NOLINTEND
151
152public:
153 // destructor thunk
154 // NOLINTBEGIN
155 MCAPI void $dtor();
156 // NOLINTEND
157
158public:
159 // vftables
160 // NOLINTBEGIN
161 MCNAPI static void** $vftable();
162 // NOLINTEND
163};
Definition CommandOrigin.h:32
Definition CommandRegistry.h:50
Definition Path.h:17
Definition FunctionEntry.h:16
static MCAPI void ** $vftable()
Definition GameRule.h:13
Definition ICommandDispatcher.h:11
Definition IFunctionEntry.h:14
Definition Value.h:16
Definition ResourcePackManager.h:30
Definition FunctionManager.h:32
Definition FunctionManager.h:53
Definition FunctionManager.h:62