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