LeviLamina
Loading...
Searching...
No Matches
ServerScoreboard.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/deps/core/utility/pub_sub/Subscription.h"
8#include "mc/world/scores/ObjectiveSortOrder.h"
9#include "mc/world/scores/Scoreboard.h"
10#include "mc/world/scores/ScoreboardId.h"
11
12// auto generated forward declare list
13// clang-format off
14class Actor;
15class BasicTimer;
17class CompoundTag;
19class EntityContext;
23class Level;
24class LevelStorage;
25class Objective;
26class PacketSender;
27class Player;
30struct ScorePacketInfo;
31// clang-format on
32
33class ServerScoreboard : public ::Scoreboard {
34public:
35 // ServerScoreboard inner types declare
36 // clang-format off
37 struct unit_test_ctor_t;
38 // clang-format on
39
40 // ServerScoreboard inner types define
42
43public:
44 // member variables
45 // NOLINTBEGIN
46 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::BasicTimer>> mSaveTimer;
47 ::ll::TypedStorage<8, 8, ::LevelStorage*> mLevelStorage;
48 ::ll::TypedStorage<1, 1, bool> mIsDirty;
49 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::GameplayUserManager> const> mGameplayUserManager;
50 ::ll::TypedStorage<8, 24, ::std::vector<::Objective const*>> mTrackedObjectives;
51 ::ll::TypedStorage<8, 8, ::PacketSender*> mPacketSender;
52 ::ll::TypedStorage<8, 16, ::ScoreboardId> mLastUniqueSBID;
53 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveSubscription;
54 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnLevelStorageManagerStartLeaveGameSubscription;
55 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnRemoveActorEntityReferencesSubscription;
56 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnGameplayUserRemovedSubscription;
57 // NOLINTEND
58
59public:
60 // prevent constructor by default
61 ServerScoreboard();
62
63public:
64 // virtual functions
65 // NOLINTBEGIN
66 virtual ~ServerScoreboard() /*override*/;
67
68 virtual void onObjectiveAdded(::Objective const& objective) /*override*/;
69
70 virtual void onObjectiveRemoved(::Objective& objective) /*override*/;
71
72 virtual void onScoreChanged(::ScoreboardId const& id, ::Objective const& obj) /*override*/;
73
74 virtual void onPlayerScoreRemoved(::ScoreboardId const& id, ::Objective const& objective) /*override*/;
75
76 virtual void setPacketSender(::PacketSender* sender) /*override*/;
77
78 virtual ::DisplayObjective const* setDisplayObjective(
79 ::std::string const& displaySlotName,
80 ::Objective const& objective,
81 ::ObjectiveSortOrder const order
82 ) /*override*/;
83
84 virtual ::Objective* clearDisplayObjective(::std::string const& displaySlotName) /*override*/;
85
86 virtual void onPlayerJoined(::Player const& player) /*override*/;
87
88 virtual void onPlayerIdentityUpdated(::PlayerScoreboardId const& playerId) /*override*/;
89
90 virtual void tick() /*override*/;
91
92 virtual ::ScoreboardId const& createScoreboardId(::Player const& player) /*override*/;
93
94 virtual ::ScoreboardId const& createScoreboardId(::Actor const& entity) /*override*/;
95
96 virtual ::ScoreboardId const& createScoreboardId(::std::string const& name) /*override*/;
97
98 virtual void writeToLevelStorage() /*override*/;
99
100 virtual bool isClientSide() const /*override*/;
101 // NOLINTEND
102
103public:
104 // member functions
105 // NOLINTBEGIN
106 MCAPI ServerScoreboard(
107 ::CommandSoftEnumRegistry registry,
108 ::LevelStorage* levelStorage,
109 ::Bedrock::NotNullNonOwnerPtr<::GameplayUserManager> gameplayUserManager
110 );
111
112 MCAPI void
113 _clearAllScoreTagsForObjective(::std::string const& displaySlotName, ::DisplayObjective const& displayObjective);
114
115 MCAPI void _clearScoreTag(::ScoreboardId const& scoreboardId);
116
117 MCAPI void _onGameplayUserRemoved(::EntityContext& entity);
118
119 MCAPI void _onRemoveActorEntityReferences(::Actor& actor);
120
121 MCFOLD void _onSaveEvent(::LevelStorage&);
122
123 MCAPI void _readFromLevelStorage();
124
125 MCAPI ::ScorePacketInfo _unpackIdentityDefToScorePacket(
126 ::ScoreboardIdentityRef const& identityDef,
127 ::std::string const& objName,
128 int score
129 );
130
131 MCAPI void
132 _updateAllScoreTagsForObjective(::std::string const& displaySlotName, ::DisplayObjective const& displayObjective);
133
134 MCAPI void _updateScoreTag(::ScoreboardId const& scoreboardId, bool);
135
136 MCAPI void deserialize(::std::unique_ptr<::CompoundTag> root);
137
138 MCFOLD void initializeImGui(::Level& level);
139
140 MCAPI void
141 initializeWithLevelStorageManagerConnector(::ILevelStorageManagerConnector& levelStorageManagerConnector);
142
143 MCAPI void intializeWithActorManager(::IActorManagerConnector& actorManagerConnector);
144
145 MCAPI ::std::unique_ptr<::CompoundTag> serialize() const;
146 // NOLINTEND
147
148public:
149 // constructor thunks
150 // NOLINTBEGIN
151 MCAPI void* $ctor(
152 ::CommandSoftEnumRegistry registry,
153 ::LevelStorage* levelStorage,
154 ::Bedrock::NotNullNonOwnerPtr<::GameplayUserManager> gameplayUserManager
155 );
156 // NOLINTEND
157
158public:
159 // destructor thunk
160 // NOLINTBEGIN
161 MCAPI void $dtor();
162 // NOLINTEND
163
164public:
165 // virtual function thunks
166 // NOLINTBEGIN
167 MCAPI void $onObjectiveAdded(::Objective const& objective);
168
169 MCAPI void $onObjectiveRemoved(::Objective& objective);
170
171 MCAPI void $onScoreChanged(::ScoreboardId const& id, ::Objective const& obj);
172
173 MCAPI void $onPlayerScoreRemoved(::ScoreboardId const& id, ::Objective const& objective);
174
175 MCAPI void $setPacketSender(::PacketSender* sender);
176
177 MCAPI ::DisplayObjective const* $setDisplayObjective(
178 ::std::string const& displaySlotName,
179 ::Objective const& objective,
180 ::ObjectiveSortOrder const order
181 );
182
183 MCAPI ::Objective* $clearDisplayObjective(::std::string const& displaySlotName);
184
185 MCAPI void $onPlayerJoined(::Player const& player);
186
187 MCAPI void $onPlayerIdentityUpdated(::PlayerScoreboardId const& playerId);
188
189 MCAPI void $tick();
190
191 MCAPI ::ScoreboardId const& $createScoreboardId(::Player const& player);
192
193 MCAPI ::ScoreboardId const& $createScoreboardId(::Actor const& entity);
194
195 MCAPI ::ScoreboardId const& $createScoreboardId(::std::string const& name);
196
197 MCAPI void $writeToLevelStorage();
198
199 MCFOLD bool $isClientSide() const;
200
201
202 // NOLINTEND
203
204public:
205 // vftables
206 // NOLINTBEGIN
207 MCAPI static void** $vftable();
208 // NOLINTEND
209};
Definition Actor.h:125
Definition BasicTimer.h:5
Definition CommandSoftEnumRegistry.h:13
Definition CompoundTag.h:23
Definition DisplayObjective.h:16
Definition EntityContext.h:17
Definition GameplayUserManager.h:22
Definition IActorManagerConnector.h:14
Definition ILevelStorageManagerConnector.h:13
Definition LevelStorage.h:26
Definition Level.h:255
Definition Objective.h:17
Definition PacketSender.h:17
Definition Player.h:137
Definition ScoreboardIdentityRef.h:20
STL namespace.
Definition PlayerScoreboardId.h:6
Definition ScorePacketInfo.h:11
Definition ScoreboardId.h:11
Definition ServerScoreboard.h:41