LeviLamina
Loading...
Searching...
No Matches
Scoreboard.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/NonOwnerPointer.h"
7#include "mc/server/commands/CommandOperator.h"
8#include "mc/server/commands/CommandSoftEnumRegistry.h"
9#include "mc/world/events/PlayerScoreboardEventListener.h"
10#include "mc/world/events/ScoreboardEventCoordinator.h"
11#include "mc/world/scores/IdentityDictionary.h"
12#include "mc/world/scores/ObjectiveRenderType.h"
13#include "mc/world/scores/ObjectiveSortOrder.h"
14#include "mc/world/scores/PlayerScoreSetFunction.h"
15
16// auto generated forward declare list
17// clang-format off
18class Actor;
19class CompoundTag;
21class Objective;
23class PacketSender;
24class Player;
26struct PlayerScore;
28struct ScoreInfo;
29struct ScoreboardId;
30// clang-format on
31
33public:
34 // member variables
35 // NOLINTBEGIN
36 ::ll::TypedStorage<8, 8, ::CommandSoftEnumRegistry> mRegistry;
37 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::DisplayObjective>> mDisplayObjectives;
38 ::ll::TypedStorage<8, 256, ::IdentityDictionary> mIdentityDict;
39 ::ll::TypedStorage<8, 64, ::std::unordered_map<::ScoreboardId, ::ScoreboardIdentityRef>> mIdentityRefs;
40 ::ll::TypedStorage<1, 1, bool> mShouldUpdateUI;
41 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::Objective>>> mObjectives;
42 ::ll::TypedStorage<8, 64, ::std::unordered_map<uint64, ::Bedrock::NonOwnerPointer<::Objective>>>
43 mObjectivesHashLookup;
44 ::ll::TypedStorage<8, 64, ::std::unordered_map<::std::string, ::std::unique_ptr<::ObjectiveCriteria>>> mCriteria;
45 ::ll::TypedStorage<8, 96, ::ScoreboardEventCoordinator> mScoreboardEventCoordinator;
46 ::ll::TypedStorage<8, 72, ::PlayerScoreboardEventListener> mPlayerListener;
47 // NOLINTEND
48
49public:
50 // prevent constructor by default
51 Scoreboard();
52
53public:
54 // virtual functions
55 // NOLINTBEGIN
56 // vIndex: 0
57 virtual ~Scoreboard();
58
59 // vIndex: 1
60 virtual ::DisplayObjective const* setDisplayObjective(
61 ::std::string const& displaySlotName,
62 ::Objective const& objective,
63 ::ObjectiveSortOrder const order
64 );
65
66 // vIndex: 2
67 virtual ::Objective* clearDisplayObjective(::std::string const& displaySlotName);
68
69 // vIndex: 5
70 virtual ::ScoreboardId const& createScoreboardId(::Player const& player);
71
72 // vIndex: 4
73 virtual ::ScoreboardId const& createScoreboardId(::Actor const& entity);
74
75 // vIndex: 3
76 virtual ::ScoreboardId const& createScoreboardId(::std::string const& fakePlayer);
77
78 // vIndex: 6
79 virtual void onObjectiveAdded(::Objective const& objective);
80
81 // vIndex: 7
82 virtual void onObjectiveRemoved(::Objective& objective);
83
84 // vIndex: 8
85 virtual void onScoreChanged(::ScoreboardId const& id, ::Objective const& obj);
86
87 // vIndex: 9
88 virtual void onPlayerScoreRemoved(::ScoreboardId const& id, ::Objective const& objective);
89
90 // vIndex: 10
91 virtual void onPlayerJoined(::Player const& player);
92
93 // vIndex: 11
94 virtual void onPlayerIdentityUpdated(::PlayerScoreboardId const& playerId);
95
96 // vIndex: 12
97 virtual void tick();
98
99 // vIndex: 13
100 virtual void setPacketSender(::PacketSender* sender);
101
102 // vIndex: 14
103 virtual void writeToLevelStorage();
104
105 // vIndex: 15
106 virtual bool isClientSide() const;
107 // NOLINTEND
108
109public:
110 // member functions
111 // NOLINTBEGIN
112 MCAPI explicit Scoreboard(::CommandSoftEnumRegistry registry);
113
114 MCAPI ::Objective*
115 addObjective(::std::string const& name, ::std::string const& displayName, ::ObjectiveCriteria const& criteria);
116
117 MCAPI int applyPlayerOperation(
118 bool& success,
119 ::std::vector<::ScoreboardId>& sourceErrorIds,
120 ::ScoreboardId const& target,
121 ::Objective& targetObjective,
122 ::std::vector<::ScoreboardId>& selector,
123 ::Objective& objective,
124 ::CommandOperator opCode
125 );
126
127 MCAPI bool clearScoreboardIdentity(::ScoreboardId const& scoreboardId);
128
129 MCAPI ::ObjectiveCriteria const&
130 createObjectiveCriteria(::std::string const& name, bool readOnly, ::ObjectiveRenderType renderType);
131
132 MCAPI ::ObjectiveCriteria* getCriteria(::std::string const& criteriaName) const;
133
134 MCAPI ::std::vector<::PlayerScore> getDisplayInfoFiltered(::std::string const& displaySlot) const;
135
136 MCAPI ::DisplayObjective const* getDisplayObjective(::std::string const& displaySlotName) const;
137
138 MCAPI ::std::vector<::std::string> getDisplayObjectiveSlotNames() const;
139
140 MCAPI ::std::vector<::ScoreInfo> getIdScores(::ScoreboardId const& id) const;
141
142 MCAPI ::Objective* getObjective(::std::string const& name) const;
143
144 MCAPI ::std::vector<::std::string> getObjectiveNames() const;
145
146 MCAPI ::std::vector<::Objective const*> getObjectives() const;
147
148 MCAPI ::ScoreboardId const& getScoreboardId(::Actor const& entity) const;
149
150 MCAPI ::ScoreboardId const& getScoreboardId(::std::string const& name) const;
151
152 MCAPI ::ScoreboardId const& getScoreboardId(::Player const& player) const;
153
154 MCAPI ::ScoreboardIdentityRef* getScoreboardIdentityRef(::ScoreboardId const& scoreboardId);
155
156 MCAPI ::std::vector<::ScoreboardIdentityRef> getScoreboardIdentityRefs() const;
157
158 MCAPI ::std::vector<::ScoreboardId> getTrackedIds() const;
159
160 MCAPI int modifyPlayerScore(
161 bool& success,
162 ::ScoreboardId const& id,
163 ::Objective& objective,
164 int scoreValue,
165 ::PlayerScoreSetFunction action
166 );
167
168 MCAPI ::ScoreboardIdentityRef const& registerScoreboardIdentity(::CompoundTag const& loadedData);
169
170 MCAPI ::ScoreboardIdentityRef const&
171 registerScoreboardIdentity(::ScoreboardId const& scoreboardId, ::std::string const& name);
172
173 MCAPI ::ScoreboardIdentityRef const&
174 registerScoreboardIdentity(::ScoreboardId const& scoreboardId, ::PlayerScoreboardId const& playerId);
175
176 MCAPI bool removeObjective(::Objective* objective);
177
178 MCAPI bool resetPlayerScore(::ScoreboardId const& id, ::Objective& objective);
179
180 MCAPI void resetPlayerScore(::ScoreboardId const& id);
181
182 MCAPI ::std::optional<::ScoreInfo> tryGetIdScore(::ScoreboardId const& id, uint64 const& objectiveHash) const;
183 // NOLINTEND
184
185public:
186 // static variables
187 // NOLINTBEGIN
188 MCAPI static ::std::string const& DEFAULT_CRITERIA();
189
190 MCAPI static ::std::string const& DISPLAY_SLOT_BELOWNAME();
191
192 MCAPI static ::std::string const& DISPLAY_SLOT_LIST();
193
194 MCAPI static ::std::string const& DISPLAY_SLOT_SIDEBAR();
195
196 MCAPI static char const*& OBJECTIVES_ENUM();
197 // NOLINTEND
198
199public:
200 // constructor thunks
201 // NOLINTBEGIN
202 MCAPI void* $ctor(::CommandSoftEnumRegistry registry);
203 // NOLINTEND
204
205public:
206 // destructor thunk
207 // NOLINTBEGIN
208 MCAPI void $dtor();
209 // NOLINTEND
210
211public:
212 // virtual function thunks
213 // NOLINTBEGIN
214 MCAPI ::DisplayObjective const* $setDisplayObjective(
215 ::std::string const& displaySlotName,
216 ::Objective const& objective,
217 ::ObjectiveSortOrder const order
218 );
219
220 MCAPI ::Objective* $clearDisplayObjective(::std::string const& displaySlotName);
221
222 MCFOLD ::ScoreboardId const& $createScoreboardId(::Player const& player);
223
224 MCFOLD ::ScoreboardId const& $createScoreboardId(::Actor const& entity);
225
226 MCFOLD ::ScoreboardId const& $createScoreboardId(::std::string const& fakePlayer);
227
228 MCAPI void $onObjectiveAdded(::Objective const& objective);
229
230 MCAPI void $onObjectiveRemoved(::Objective& objective);
231
232 MCAPI void $onScoreChanged(::ScoreboardId const& id, ::Objective const& obj);
233
234 MCFOLD void $onPlayerScoreRemoved(::ScoreboardId const& id, ::Objective const& objective);
235
236 MCFOLD void $onPlayerJoined(::Player const& player);
237
238 MCFOLD void $onPlayerIdentityUpdated(::PlayerScoreboardId const& playerId);
239
240 MCFOLD void $tick();
241
242 MCFOLD void $setPacketSender(::PacketSender* sender);
243
244 MCFOLD void $writeToLevelStorage();
245
246 MCFOLD bool $isClientSide() const;
247 // NOLINTEND
248
249public:
250 // vftables
251 // NOLINTBEGIN
252 MCNAPI static void** $vftable();
253 // NOLINTEND
254};
Definition Actor.h:103
Definition CommandSoftEnumRegistry.h:10
Definition CompoundTag.h:13
Definition DisplayObjective.h:14
Definition ObjectiveCriteria.h:13
Definition Objective.h:17
Definition PacketSender.h:17
Definition Player.h:119
Definition ScoreboardIdentityRef.h:17
Definition Scoreboard.h:32
static MCAPI void ** $vftable()
Definition PlayerScore.h:5
Definition PlayerScoreboardId.h:6
Definition ScoreInfo.h:10
Definition ScoreboardId.h:10