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