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;
55 LLAPI
int modifyPlayerScore(
56 ScoreboardOperationResult& result,
60 PlayerScoreSetFunction action
65 [[nodiscard]] std::vector<::Objective const*> getObjectives()
const {
66 std::vector<::Objective const*> result;
67 for (
auto const& [name, objective] : *mObjectives) {
68 result.emplace_back(objective.get());
79 virtual ~Scoreboard();
81 virtual ~Scoreboard() =
default;
84 virtual ::DisplayObjective
const* setDisplayObjective(
85 ::std::string
const& displaySlotName,
87 ::ObjectiveSortOrder
const order
90 virtual ::Objective* clearDisplayObjective(::std::string
const& displaySlotName);
92 virtual ::ScoreboardId
const& createScoreboardId(
::Player const& player);
94 virtual ::ScoreboardId
const& createScoreboardId(
::Actor const& entity);
96 virtual ::ScoreboardId
const& createScoreboardId(::std::string
const& fakePlayer);
98 virtual void onObjectiveAdded(
::Objective const& objective);
100 virtual void onObjectiveRemoved(
::Objective& objective);
106 virtual void onPlayerJoined(
::Player const& player);
114 virtual void writeToLevelStorage();
116 virtual bool isClientSide()
const;
125 MCAPI
void _addLoadedCriteria(::std::unique_ptr<::ObjectiveCriteria> newCriteria);
127 MCAPI
void _addLoadedObjective(::std::unique_ptr<::Objective> newObjective);
131 addObjective(::std::string
const& name, ::std::string
const& displayName,
::ObjectiveCriteria const& criteria);
133 MCAPI
int applyPlayerOperation(
134 ::ScoreboardOperationResult& result,
135 ::std::vector<::ScoreboardId>& sourceErrorIds,
138 ::std::vector<::ScoreboardId>& selector,
140 ::CommandOperator opCode
144 MCAPI
bool clearScoreboardIdentity(
::ScoreboardId const& scoreboardId);
147 MCAPI ::ObjectiveCriteria* getCriteria(::std::string
const& criteriaName)
const;
149 MCAPI ::std::vector<::PlayerScore> getDisplayInfoFiltered(::std::string
const& displaySlot)
const;
152 MCAPI ::std::vector<::PlayerScore> getDisplayInfoSorted(
153 ::std::string
const& displaySlot,
154 ::std::function<
void(::ObjectiveSortOrder, ::std::vector<::PlayerScore>&)> sortMethod
158 MCAPI ::DisplayObjective
const* getDisplayObjective(::std::string
const& displaySlotName)
const;
160 MCAPI ::std::vector<::std::string> getDisplayObjectiveSlotNames()
const;
162 MCAPI ::Objective* getObjective(::std::string
const& name)
const;
164 MCAPI ::ScoreboardId
const& getScoreboardId(
::Actor const& entity)
const;
167 MCAPI ::ScoreboardId
const& getScoreboardId(
::ActorUniqueID const& entityId)
const;
170 MCAPI ::ScoreboardId
const& getScoreboardId(::std::string
const& name)
const;
173 MCAPI ::std::vector<::ScoreboardId> getTrackedIds()
const;
175 MCAPI ::ScoreboardIdentityRef
const& registerScoreboardIdentity(
::CompoundTag const& loadedData);
178 MCAPI ::ScoreboardIdentityRef
const&
181 MCAPI
bool removeObjective(
::Objective* objective);
184 MCAPI
void removeScoreListener(
::Player const& player);
187 MCAPI
void removeScoreListener(
::Player const& player, ::std::string
const& objective);
191 MCAPI ::std::optional<::ScoreInfo> tryGetIdScore(
::ScoreboardId const&
id, uint64
const& objectiveHash)
const;
197 MCAPI static ::std::string
const& DEFAULT_CRITERIA();
199 MCAPI static ::std::string
const& DISPLAY_SLOT_BELOWNAME();
201 MCAPI static ::std::string
const& DISPLAY_SLOT_LIST();
203 MCAPI static ::std::string
const& DISPLAY_SLOT_SIDEBAR();
205 MCAPI
static char const*& OBJECTIVES_ENUM();
225 MCAPI ::DisplayObjective
const* $setDisplayObjective(
226 ::std::string
const& displaySlotName,
228 ::ObjectiveSortOrder
const order
231 MCAPI ::Objective* $clearDisplayObjective(::std::string
const& displaySlotName);
233 MCAPI ::ScoreboardId
const& $createScoreboardId(
::Player const& player);
235 MCAPI ::ScoreboardId
const& $createScoreboardId(
::Actor const& entity);
237 MCAPI ::ScoreboardId
const& $createScoreboardId(::std::string
const& fakePlayer);
239 MCAPI
void $onObjectiveAdded(
::Objective const& objective);
241 MCAPI
void $onObjectiveRemoved(
::Objective& objective);
247 MCFOLD
void $onPlayerJoined(
::Player const& player);
255 MCFOLD
void $writeToLevelStorage();
257 MCFOLD
bool $isClientSide()
const;