LeviLamina
Loading...
Searching...
No Matches
ScoreboardCommand.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/server/commands/Command.h"
7#include "mc/server/commands/CommandOperator.h"
8#include "mc/server/commands/CommandWildcardInt.h"
9#include "mc/server/commands/WildcardCommandSelector.h"
10#include "mc/world/scores/ObjectiveSortOrder.h"
11#include "mc/world/scores/PlayerScoreSetFunction.h"
12
13// auto generated forward declare list
14// clang-format off
15class Actor;
16class CommandOrigin;
17class CommandOutput;
18class CommandRegistry;
19class Objective;
20class Scoreboard;
21class ServerLevel;
22struct ActorUniqueID;
23struct ScoreboardId;
24// clang-format on
25
26class ScoreboardCommand : public ::Command {
27public:
28 // ScoreboardCommand inner types declare
29 // clang-format off
30 struct InitProxy;
31 struct SetScoreOutput;
32 // clang-format on
33
34 // ScoreboardCommand inner types define
35 enum class Action : int {
36 Invalid = 0,
37 Add = 1,
38 List = 2,
39 Operation = 3,
40 Random = 4,
41 Remove = 5,
42 Reset = 6,
43 Set = 7,
44 SetDisplay = 8,
45 Test = 9,
46 };
47
48 enum class Category : int {
49 Objectives = 0,
50 Players = 1,
51 };
52
53 struct InitProxy {
54 public:
55 // member variables
56 // NOLINTBEGIN
57 ::ll::TypedStorage<8, 8, ::Scoreboard&> mScoreboard;
58 // NOLINTEND
59
60 public:
61 // prevent constructor by default
62 InitProxy& operator=(InitProxy const&);
63 InitProxy(InitProxy const&);
64 InitProxy();
65
66 public:
67 // member functions
68 // NOLINTBEGIN
69 MCAPI explicit InitProxy(::ServerLevel& level);
70 // NOLINTEND
71
72 public:
73 // constructor thunks
74 // NOLINTBEGIN
75 MCAPI void* $ctor(::ServerLevel& level);
76 // NOLINTEND
77 };
78
80 public:
81 // member variables
82 // NOLINTBEGIN
83 ::ll::TypedStorage<4, 4, int> mSuccessCount;
84 ::ll::TypedStorage<4, 4, int> mFirstNewScore;
85 ::ll::TypedStorage<8, 32, ::std::string> mFirstSuccess;
86 // NOLINTEND
87
88 public:
89 // member functions
90 // NOLINTBEGIN
91 MCAPI ~SetScoreOutput();
92 // NOLINTEND
93
94 public:
95 // destructor thunk
96 // NOLINTBEGIN
97 MCFOLD void $dtor();
98 // NOLINTEND
99 };
100
101public:
102 // member variables
103 // NOLINTBEGIN
104 ::ll::TypedStorage<4, 4, ::ScoreboardCommand::Category> mCategory;
105 ::ll::TypedStorage<4, 4, ::ScoreboardCommand::Action> mAction;
106 ::ll::TypedStorage<8, 32, ::std::string> mObjective;
107 ::ll::TypedStorage<8, 32, ::std::string> mSourceObjective;
108 ::ll::TypedStorage<1, 1, ::ObjectiveSortOrder> mOrder;
109 ::ll::TypedStorage<8, 32, ::std::string> mCriteria;
110 ::ll::TypedStorage<8, 32, ::std::string> mName;
111 ::ll::TypedStorage<8, 32, ::std::string> mDisplayName;
112 ::ll::TypedStorage<8, 200, ::WildcardCommandSelector<::Actor>> mTargets;
113 ::ll::TypedStorage<8, 200, ::WildcardCommandSelector<::Actor>> mSources;
114 ::ll::TypedStorage<1, 1, ::CommandOperator> mOperator;
115 ::ll::TypedStorage<4, 8, ::CommandWildcardInt> mMin;
116 ::ll::TypedStorage<4, 8, ::CommandWildcardInt> mMax;
117 ::ll::TypedStorage<4, 4, int> mRandMin;
118 ::ll::TypedStorage<4, 4, int> mRandMax;
119 ::ll::TypedStorage<4, 4, int> mValue;
120 ::ll::TypedStorage<1, 1, bool> mTargetsSet;
121 // NOLINTEND
122
123public:
124 // virtual functions
125 // NOLINTBEGIN
126 virtual void execute(::CommandOrigin const& origin, ::CommandOutput& output) const /*override*/;
127 // NOLINTEND
128
129public:
130 // member functions
131 // NOLINTBEGIN
132 MCAPI ScoreboardCommand();
133
134 MCAPI void _generateCumulativeOutput(
135 ::ScoreboardCommand::SetScoreOutput const& cumulativeOutput,
136 ::Objective const& objective,
137 ::CommandOutput& output
138 ) const;
139
140 MCAPI ::Objective* _getObjective(
141 ::Scoreboard const& scoreboard,
142 ::std::string const& name,
143 bool forWrite,
144 ::CommandOutput& output
145 ) const;
146
147 MCAPI ::std::vector<::ScoreboardId> _getScoreboardIdsForSelector(
148 ::Scoreboard& scoreboard,
150 ::CommandOrigin const& origin,
151 ::CommandOutput& output,
152 bool shouldCreateMissingId
153 ) const;
154
155 MCAPI bool _getSelectorResultsForObjective(
156 ::std::vector<::ScoreboardId>& results,
157 ::Scoreboard& scoreboard,
159 ::Objective& objective,
160 ::CommandOrigin const& origin,
161 ::CommandOutput& output,
162 bool shouldCreateMissingId
163 ) const;
164
165 MCAPI void addObjective(
166 ::Scoreboard& scoreboard,
167 ::std::string const& name,
168 ::std::string const& criteriaName,
169 ::std::string const& displayName,
170 ::CommandOutput& output
171 ) const;
172
173 MCAPI void addPlayerScore(
174 ::Scoreboard& scoreboard,
175 ::PlayerScoreSetFunction fn,
176 ::ScoreboardId const& targetId,
177 ::Objective& objective,
178 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
179 ::CommandOutput& output,
181 ) const;
182
183 MCAPI bool applyPlayerOperation(
184 ::Scoreboard& scoreboard,
185 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
186 ::ScoreboardId const& targetId,
187 ::Objective& targetObjective,
188 ::Objective& objective,
189 ::CommandOrigin const& origin,
190 ::CommandOutput& output,
192 ) const;
193
194 MCAPI void listObjectives(::Scoreboard const& scoreboard, ::CommandOutput& output) const;
195
196 MCAPI void listPlayers(
197 ::Scoreboard& scoreboard,
198 ::ScoreboardId const& targetId,
199 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
200 ::CommandOutput& output
201 ) const;
202
203 MCAPI void objectives(::Scoreboard& scoreboard, ::CommandOrigin const& output, ::CommandOutput&) const;
204
205 MCAPI void players(::Scoreboard& scoreboard, ::CommandOrigin const& origin, ::CommandOutput& output) const;
206
207 MCAPI void removeObjective(::Scoreboard& scoreboard, ::std::string const& name, ::CommandOutput& output) const;
208
209 MCAPI void resetPlayer(
210 ::Scoreboard& scoreboard,
211 ::ScoreboardId const& targetId,
212 ::Objective* objective,
213 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
214 ::CommandOutput& output
215 ) const;
216
217 MCAPI void setDisplayObjective(
218 ::Scoreboard& scoreboard,
219 ::std::string const& displaySlotName,
220 ::std::string const& objectiveName,
221 ::ObjectiveSortOrder order,
222 ::CommandOutput& output
223 ) const;
224
225 MCAPI bool setPlayerRandomScore(
226 ::Scoreboard& scoreboard,
227 ::ScoreboardId const& targetId,
228 ::Objective& targetObjective,
229 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
230 ::CommandOutput& output,
232 ) const;
233
234 MCAPI void testPlayerScore(
235 ::ScoreboardId const& targetId,
236 ::Objective& objective,
237 ::std::function<::std::string const&(::ActorUniqueID)> const& playerNameResolver,
238 ::CommandOutput& output
239 ) const;
240 // NOLINTEND
241
242public:
243 // static functions
244 // NOLINTBEGIN
245 MCAPI static ::std::vector<::std::string> _getNonSortableDisplaySlots(::Scoreboard&);
246
247 MCAPI static ::std::vector<::std::string> _getSortableDisplaySlots(::Scoreboard& scoreboard);
248
249 MCAPI static void setup(::CommandRegistry& registry, ::ScoreboardCommand::InitProxy&& dependencies);
250 // NOLINTEND
251
252public:
253 // constructor thunks
254 // NOLINTBEGIN
255 MCAPI void* $ctor();
256 // NOLINTEND
257
258public:
259 // virtual function thunks
260 // NOLINTBEGIN
261 MCAPI void $execute(::CommandOrigin const& origin, ::CommandOutput& output) const;
262
263
264 // NOLINTEND
265
266public:
267 // vftables
268 // NOLINTBEGIN
269 MCNAPI static void** $vftable();
270 // NOLINTEND
271};
272
273// clang-format off
274template <>
275MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, ::ScoreboardCommand::Action>();
276template <>
277MCAPI ::ll::type_id_ref Bedrock::typeid_storage_impl<class CommandRegistry, ::ScoreboardCommand::Category>();
278// clang-format on
Definition Actor.h:125
Definition CommandOrigin.h:32
Definition CommandOutput.h:20
Definition CommandRegistry.h:51
Definition Objective.h:17
Definition Random.h:10
static MCAPI void ** $vftable()
Definition Scoreboard.h:35
Definition ServerLevel.h:59
Definition WildcardCommandSelector.h:12
Definition ActorUniqueID.h:10
Definition ScoreboardCommand.h:53
Definition ScoreboardCommand.h:79
Definition ScoreboardId.h:11