LeviLamina
Loading...
Searching...
No Matches
GameRule.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated forward declare list
6// clang-format off
8// clang-format on
9
10class GameRule {
11public:
12 // GameRule inner types declare
13 // clang-format off
14 class ValidationError;
15 // clang-format on
16
17 // GameRule inner types define
18 enum class Type : uchar {
19 Invalid = 0,
20 Bool = 1,
21 Int = 2,
22 Float = 3,
23 };
24
25 using Value = ::std::variant<::std::monostate, bool, int, float>;
26
28 public:
29 // member variables
30 // NOLINTBEGIN
31 ::ll::TypedStorage<1, 1, bool> mSuccess;
32 ::ll::TypedStorage<8, 32, ::std::string> mErrorDescription;
33 ::ll::TypedStorage<8, 24, ::std::vector<::std::string>> mErrorParameters;
34 // NOLINTEND
35
36 public:
37 // member functions
38 // NOLINTBEGIN
40 // NOLINTEND
41
42 public:
43 // destructor thunk
44 // NOLINTBEGIN
45 MCNAPI void $dtor();
46 // NOLINTEND
47 };
48
49 using TagDataNotFoundCallback = ::std::function<void(::GameRule&, ::BaseGameVersion const&)>;
50
51 using ValidateValueCallback =
52 ::std::function<bool(::std::variant<::std::monostate, bool, int, float> const&, ::GameRule::ValidationError*)>;
53
54public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<1, 1, bool> mShouldSave;
58 ::ll::TypedStorage<1, 1, ::GameRule::Type> mType;
59 ::ll::TypedStorage<4, 8, ::std::variant<::std::monostate, bool, int, float>> mValue;
60 ::ll::TypedStorage<8, 32, ::std::string> mName;
61 ::ll::TypedStorage<1, 1, bool> mAllowUseInCommand;
62 ::ll::TypedStorage<1, 1, bool> mAllowUseInScripting;
63 ::ll::TypedStorage<1, 1, bool> mIsDefaultSet;
64 ::ll::TypedStorage<1, 1, bool> mRequiresCheats;
65 ::ll::TypedStorage<1, 1, bool> mCanBeModifiedByPlayer;
66 ::ll::TypedStorage<8, 64, ::std::function<void(::GameRule&, ::BaseGameVersion const&)>> mTagNotFoundCallback;
67 ::ll::TypedStorage<
68 8,
69 64,
70 ::std::function<bool(::std::variant<::std::monostate, bool, int, float> const&, ::GameRule::ValidationError*)>>
71 mValidateValueCallback;
72 // NOLINTEND
73
74public:
75 // prevent constructor by default
76 GameRule();
77
78public:
79 // member functions
80 // NOLINTBEGIN
81 MCAPI GameRule(::GameRule const&);
82
83 MCAPI GameRule(::GameRule&&);
84
85 MCAPI GameRule(::std::string const& name, bool canBeModifiedByPlayer);
86
87 MCAPI ::GameRule& _setDefaultValue(bool b);
88
89 MCAPI ::GameRule& _setDefaultValue(int i);
90
91 MCAPI ::std::string getLowercaseName() const;
92
93 MCAPI ::GameRule& operator=(::GameRule&&);
94
95 MCAPI ::GameRule& operator=(::GameRule const&);
96
97 MCAPI bool operator==(::GameRule const& other) const;
98
99 MCAPI void resetType(::GameRule::Type type);
100
101 MCAPI bool setBool(bool value, bool* pValidated, ::GameRule::ValidationError* errorOutput);
102
103 MCAPI bool setFloat(float value, bool* pValidated, ::GameRule::ValidationError* errorOutput);
104
105 MCAPI bool setInt(int value, bool* pValidated, ::GameRule::ValidationError* errorOutput);
106
107 MCAPI ::GameRule& setTagDataNotFoundCallback(::std::function<void(::GameRule&, ::BaseGameVersion const&)> cb);
108
109 MCAPI ::GameRule& setValidateValueCallback(
110 ::std::function<bool(::std::variant<::std::monostate, bool, int, float> const&, ::GameRule::ValidationError*)>
111 cb
112 );
113
114 MCAPI ~GameRule();
115 // NOLINTEND
116
117public:
118 // constructor thunks
119 // NOLINTBEGIN
120 MCAPI void* $ctor(::GameRule const&);
121
122 MCAPI void* $ctor(::GameRule&&);
123
124 MCAPI void* $ctor(::std::string const& name, bool canBeModifiedByPlayer);
125 // NOLINTEND
126
127public:
128 // destructor thunk
129 // NOLINTBEGIN
130 MCAPI void $dtor();
131 // NOLINTEND
132};
Definition BaseGameVersion.h:8
Definition GameRule.h:27
Definition GameRule.h:10