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, 96, ::ScoreboardEventCoordinator> mScoreboardEventCoordinator;
46 ::ll::TypedStorage<8, 72, ::PlayerScoreboardEventListener> mPlayerListener;
54 LLAPI
int modifyPlayerScore(
55 ScoreboardOperationResult& result,
59 PlayerScoreSetFunction action
64 [[nodiscard]] std::vector<::Objective const*> getObjectives()
const {
65 std::vector<::Objective const*> result;
66 for (
auto const& [name, objective] : *mObjectives) {
67 result.emplace_back(objective.get());
75 virtual ~Scoreboard() =
default;
77 virtual ::DisplayObjective
const* setDisplayObjective(
78 ::std::string
const& displaySlotName,
80 ::ObjectiveSortOrder
const order
83 virtual ::Objective* clearDisplayObjective(::std::string
const& displaySlotName);
85 virtual ::ScoreboardId
const& createScoreboardId(
::Player const& player);
87 virtual ::ScoreboardId
const& createScoreboardId(
::Actor const& entity);
89 virtual ::ScoreboardId
const& createScoreboardId(::std::string
const& fakePlayer);
91 virtual void onObjectiveAdded(
::Objective const& objective);
93 virtual void onObjectiveRemoved(
::Objective& objective);
99 virtual void onPlayerJoined(
::Player const& player);
107 virtual void writeToLevelStorage();
109 virtual bool isClientSide()
const;
118 addObjective(::std::string
const& name, ::std::string
const& displayName,
::ObjectiveCriteria const& criteria);
120 MCAPI
int applyPlayerOperation(
121 ::ScoreboardOperationResult& result,
122 ::std::vector<::ScoreboardId>& sourceErrorIds,
125 ::std::vector<::ScoreboardId>& selector,
127 ::CommandOperator opCode
131 MCAPI
bool clearScoreboardIdentity(
::ScoreboardId const& scoreboardId);
134 MCAPI ::ObjectiveCriteria* getCriteria(::std::string
const& criteriaName)
const;
136 MCAPI ::std::vector<::PlayerScore> getDisplayInfoFiltered(::std::string
const& displaySlot)
const;
139 MCAPI ::std::vector<::PlayerScore> getDisplayInfoSorted(
140 ::std::string
const& displaySlot,
141 ::std::function<
void(::ObjectiveSortOrder, ::std::vector<::PlayerScore>&)> sortMethod
145 MCAPI ::DisplayObjective
const* getDisplayObjective(::std::string
const& displaySlotName)
const;
147 MCAPI ::std::vector<::std::string> getDisplayObjectiveSlotNames()
const;
149 MCAPI ::Objective* getObjective(::std::string
const& name)
const;
151 MCAPI ::ScoreboardId
const& getScoreboardId(
::Actor const& entity)
const;
153 MCAPI ::ScoreboardId
const& getScoreboardId(
::ActorUniqueID const& entityId)
const;
155 MCAPI ::ScoreboardId
const& getScoreboardId(::std::string
const& name)
const;
157 MCAPI ::std::vector<::ScoreboardId> getTrackedIds()
const;
159 MCAPI ::ScoreboardIdentityRef
const&
162 MCAPI
bool removeObjective(
::Objective* objective);
164 MCAPI
void removeScoreListener(
::Player const& player, ::std::string
const& objective);
170 MCAPI ::std::optional<::ScoreInfo> tryGetIdScore(
::ScoreboardId const&
id, uint64
const& objectiveHash)
const;
176 MCAPI static ::std::string
const& DEFAULT_CRITERIA();
178 MCAPI static ::std::string
const& DISPLAY_SLOT_BELOWNAME();
180 MCAPI static ::std::string
const& DISPLAY_SLOT_LIST();
182 MCAPI static ::std::string
const& DISPLAY_SLOT_SIDEBAR();
184 MCAPI
static char const*& OBJECTIVES_ENUM();
196 MCAPI ::DisplayObjective
const* $setDisplayObjective(
197 ::std::string
const& displaySlotName,
199 ::ObjectiveSortOrder
const order
202 MCAPI ::Objective* $clearDisplayObjective(::std::string
const& displaySlotName);
204 MCAPI ::ScoreboardId
const& $createScoreboardId(
::Player const& player);
206 MCAPI ::ScoreboardId
const& $createScoreboardId(
::Actor const& entity);
208 MCAPI ::ScoreboardId
const& $createScoreboardId(::std::string
const& fakePlayer);
210 MCAPI
void $onObjectiveAdded(
::Objective const& objective);
212 MCAPI
void $onObjectiveRemoved(
::Objective& objective);
218 MCFOLD
void $onPlayerJoined(
::Player const& player);
226 MCFOLD
void $writeToLevelStorage();
228 MCFOLD
bool $isClientSide()
const;