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