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());
77 virtual ~Scoreboard() =
default;
79 virtual ::DisplayObjective
const* setDisplayObjective(
80 ::std::string
const& displaySlotName,
82 ::ObjectiveSortOrder
const order
85 virtual ::Objective* clearDisplayObjective(::std::string
const& displaySlotName);
87 virtual ::ScoreboardId
const& createScoreboardId(
::Player const& player);
89 virtual ::ScoreboardId
const& createScoreboardId(
::Actor const& entity);
91 virtual ::ScoreboardId
const& createScoreboardId(::std::string
const& fakePlayer);
93 virtual void onObjectiveAdded(
::Objective const& objective);
95 virtual void onObjectiveRemoved(
::Objective& objective);
101 virtual void onPlayerJoined(
::Player const& player);
109 virtual void writeToLevelStorage();
111 virtual bool isClientSide()
const;
120 addObjective(::std::string
const& name, ::std::string
const& displayName,
::ObjectiveCriteria const& criteria);
123 ::ScoreboardOperationResult& result,
124 ::std::vector<::ScoreboardId>& sourceErrorIds,
127 ::std::vector<::ScoreboardId>& selector,
129 ::CommandOperator opCode
133 MCNAPI
bool clearScoreboardIdentity(
::ScoreboardId const& scoreboardId);
136 MCAPI ::ObjectiveCriteria* getCriteria(::std::string
const& criteriaName)
const;
141 MCNAPI ::std::vector<::PlayerScore> getDisplayInfoSorted(
142 ::std::string
const& displaySlot,
143 ::std::function<
void(::ObjectiveSortOrder, ::std::vector<::PlayerScore>&)> sortMethod
147 MCAPI ::DisplayObjective
const* getDisplayObjective(::std::string
const& displaySlotName)
const;
149 MCAPI ::std::vector<::std::string> getDisplayObjectiveSlotNames()
const;
151 MCAPI ::Objective* getObjective(::std::string
const& name)
const;
153 MCAPI ::ScoreboardId
const& getScoreboardId(
::Actor const& entity)
const;
157 MCAPI ::ScoreboardId
const& getScoreboardId(::std::string
const& name)
const;
159 MCAPI ::std::vector<::ScoreboardId> getTrackedIds()
const;
161 MCNAPI ::ScoreboardIdentityRef
const&
164 MCAPI
bool removeObjective(
::Objective* objective);
170 MCAPI ::std::optional<::ScoreInfo> tryGetIdScore(
::ScoreboardId const&
id, uint64
const& objectiveHash)
const;
176 MCAPI static ::std::string
const& DEFAULT_CRITERIA();
197 ::std::string
const& displaySlotName,
199 ::ObjectiveSortOrder
const order
MCAPI int applyPlayerOperation(::ScoreboardOperationResult &result, ::std::vector<::ScoreboardId > &sourceErrorIds, ::ScoreboardId const &target, ::Objective &targetObjective, ::std::vector<::ScoreboardId > &selector, ::Objective &objective, ::CommandOperator opCode)