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