LeviLamina
Loading...
Searching...
No Matches
CommandParameterData.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/typeid_t.h"
7#include "mc/server/commands/CommandParameterDataType.h"
8#include "mc/server/commands/CommandParameterOption.h"
9#include "mc/server/commands/CommandRegistry.h"
10
11// auto generated forward declare list
12// clang-format off
13class Command;
14class CommandOrigin;
15class CommandRegistry;
16// clang-format on
17
18class CommandParameterData {
19public:
20 // CommandParameterData inner types define
21 using CustomStorageGetFn = void* (*)(::Command*, int);
22
23 using CustomStorageIsSetFn = bool* (*)(::Command*, int);
24
25 using ParseFunction = bool (CommandRegistry::*)(
26 void*,
28 ::CommandOrigin const&,
29 int,
30 ::std::string&,
31 ::std::vector<::std::string>&
32 ) const;
33
34public:
35 // member variables
36 // NOLINTBEGIN
38 ::CommandRegistry::ParamParseRule const* mParseRule;
39 ParseFunction mParseOverride;
40 ::std::string mName;
41 char const* mEnumNameOrPostfix;
42 CommandRegistry::Symbol mEnumOrPostfixSymbol;
43 char const* mChainedSubcommand;
44 CommandRegistry::Symbol mChainedSubcommandSymbol;
45 ::CommandParameterDataType mParamType;
46 int mOffset;
47 int mSetOffset;
48 bool mIsOptional;
49 ::CommandParameterOption mOptions;
50 ::ll::TypedStorage<8, 8, void* (*)(::Command*, int)> mValueGetFn{};
51 ::ll::TypedStorage<8, 8, bool* (*)(::Command*, int)> mValueIsSetFn{};
52 // NOLINTEND
53
54public:
55 void addOptions(::CommandParameterOption option) {
56 using T = std::underlying_type_t<::CommandParameterOption>;
57 mOptions = static_cast<::CommandParameterOption>((T)option | (T)mOptions);
58 }
59
60 CommandParameterData() = default;
61
62 LLNDAPI CommandParameterData(
64 ParseFunction parser,
65 std::string name,
66 ::CommandParameterDataType type,
67 char const* enumNameOrPostfix,
68 char const* subChain,
69 int offset,
70 bool optional,
71 int flagOffset,
72 CommandParameterOption options,
73 ::CommandRegistry::ParamParseRule const* rule = nullptr
74 );
75
76 LLNDAPI bool operator==(CommandParameterData const& other) const;
77
78 CommandParameterData(CommandParameterData const&) = default;
79 CommandParameterData& operator=(CommandParameterData const&) = default;
80
81public:
82 // destructor thunk
83 // NOLINTBEGIN
84 MCFOLD void $dtor();
85 // NOLINTEND
86};
Definition typeid_t.h:25
Definition CommandOrigin.h:32
Definition CommandRegistry.h:264
Definition CommandRegistry.h:51
Definition Command.h:18
Definition CommandRegistry.h:471
Definition CommandRegistry.h:398