Skip to content
LeviMC
English
AutoLightDark
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/functions/FunctionQueueOrder.h"
8
9// auto generated forward declare list
10// clang-format off
11class CommandRegistry;
12class FunctionEntry;
13class GameRule;
15class IFunctionEntry;
17// clang-format on
18
19class FunctionManager {
20public:
21 // FunctionManager inner types declare
22 // clang-format off
23 struct OriginMapping;
24 struct QueuedCommand;
25 struct TickFunction;
26 // clang-format on
27
28 // FunctionManager inner types define
30 public:
31 // member variables
32 // NOLINTBEGIN
33 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOrigin>> mOrigin;
34 ::ll::TypedStorage<4, 4, uint> mRefCount;
35 // NOLINTEND
36 };
37
39 public:
40 // member variables
41 // NOLINTBEGIN
42 ::ll::TypedStorage<8, 8, ::IFunctionEntry*> mFunction;
43 ::ll::TypedStorage<8, 8, ::gsl::not_null<::CommandOrigin const*>> mOrigin;
44 // NOLINTEND
45 };
46
47 struct TickFunction {
48 public:
49 // member variables
50 // NOLINTBEGIN
51 ::ll::TypedStorage<8, 8, ::gsl::not_null<::FunctionEntry*>> mFunction;
52 ::ll::TypedStorage<1, 1, ::FunctionQueueOrder> mOrder;
53 // NOLINTEND
54 };
55
56public:
57 // member variables
58 // NOLINTBEGIN
59 ::ll::TypedStorage<8, 8, ::GameRule const*> mGameRule;
60 ::ll::TypedStorage<1, 1, bool> mIsProcessingStack;
61 ::ll::TypedStorage<8, 8, uint64> mInsertPoint;
62 ::ll::TypedStorage<4, 4, int> mExecutionCount;
63 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::QueuedCommand>> mCommandList;
64 ::ll::TypedStorage<8, 64, ::std::unordered_map<::CommandOrigin const*, ::FunctionManager::OriginMapping>>
65 mOriginMap;
66 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ICommandDispatcher>> mCommandDispatcher;
67 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::CommandOrigin>> mTickOrigin;
68 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::FunctionEntry>>> mFunctions;
69 ::ll::TypedStorage<8, 24, ::std::vector<::FunctionManager::TickFunction>> mTickFunctions;
70 // NOLINTEND
71
72public:
73 // prevent constructor by default
74 FunctionManager();
75
76public:
77 // virtual functions
78 // NOLINTBEGIN
79 virtual ~FunctionManager() = default;
80 // NOLINTEND
81
82public:
83 // member functions
84 // NOLINTBEGIN
86 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
87 ::std::unique_ptr<::CommandOrigin> tickOrigin,
88 ::GameRule const* gameRule
89 );
90
91 MCNAPI ::CommandOrigin const& _addOriginReference(::CommandOrigin const& origin, uint amount);
92
93 MCNAPI int
94 _processCommandStack(::FunctionEntry& toExecute, ::CommandOrigin const& origin, ::FunctionQueueOrder order);
95
96 MCNAPI void _removeOriginReference(::CommandOrigin const& origin, uint amount);
97
98 MCNAPI ::FunctionEntry* getFunction(::std::string const& functionName);
99
100 MCNAPI void load(::ResourcePackManager& serverPackManager, ::CommandRegistry& registry);
101 // NOLINTEND
102
103public:
104 // constructor thunks
105 // NOLINTBEGIN
106 MCNAPI void* $ctor(
107 ::std::unique_ptr<::ICommandDispatcher> commandDispatcher,
108 ::std::unique_ptr<::CommandOrigin> tickOrigin,
109 ::GameRule const* gameRule
110 );
111 // NOLINTEND
112
113public:
114 // vftables
115 // NOLINTBEGIN
116 MCNAPI static void** $vftable();
117 // NOLINTEND
118};
Definition CommandOrigin.h:32
Definition CommandRegistry.h:51
Definition FunctionEntry.h:16
static MCAPI void ** $vftable()
MCAPI::FunctionEntry * getFunction(::std::string const &functionName)
MCAPI void _removeOriginReference(::CommandOrigin const &origin, uint amount)
MCAPI void load(::ResourcePackManager &serverPackManager, ::CommandRegistry &registry)
MCAPI void * $ctor(::std::unique_ptr<::ICommandDispatcher > commandDispatcher, ::std::unique_ptr<::CommandOrigin > tickOrigin, ::GameRule const *gameRule)
MCAPI FunctionManager(::std::unique_ptr<::ICommandDispatcher > commandDispatcher, ::std::unique_ptr<::CommandOrigin > tickOrigin, ::GameRule const *gameRule)
MCAPI::CommandOrigin const & _addOriginReference(::CommandOrigin const &origin, uint amount)
MCAPI int _processCommandStack(::FunctionEntry &toExecute, ::CommandOrigin const &origin, ::FunctionQueueOrder order)
Definition GameRule.h:14
Definition ICommandDispatcher.h:11
Definition IFunctionEntry.h:14
Definition ResourcePackManager.h:29
Definition FunctionManager.h:29
Definition FunctionManager.h:38
Definition FunctionManager.h:47