endstone::Scoreboard
Represents a scoreboard.
Bases: std::enable_shared_from_this< Scoreboard >
Functions:
Name | Description |
---|---|
addObjective | Registers an Objective on this Scoreboard . |
addObjective | Registers an Objective on this Scoreboard . |
addObjective | Registers an Objective on this Scoreboard . |
clearSlot | Clears any objective in the specified slot. |
getEntries | Gets all entries tracked by this Scoreboard . |
getObjective | Gets an Objective on this Scoreboard by name. |
getObjective | Gets the Objective currently displayed in a DisplaySlot on this Scoreboard . |
getObjectives | Gets all Objectives on this Scoreboard . |
getObjectivesByCriteria | Gets all Objectives of a Criteria on the Scoreboard . |
getScores | Gets all scores for an entry on this Scoreboard . |
resetScores | Removes all scores for an entry on this Scoreboard . |
addObjective
Result<std::unique_ptr<Objective>> addObjective(std::string name,
Criteria::Type criteria)
Registers an Objective on this Scoreboard .
Parameters:
Returns:
A reference to the newly registered Objective.
Result<std::unique_ptr<Objective>> addObjective(std::string name,
Criteria::Type criteria,
std::string display_name)
Registers an Objective on this Scoreboard .
Parameters:
name
Name of the Objectivecriteria
Criteria type for the Objectivedisplay_name
Name displayed to players for the Objective.
Returns:
A reference to the newly registered Objective.
Result<std::unique_ptr<Objective>> addObjective(std::string name,
Criteria::Type criteria,
std::string display_name,
RenderType render_type)
Registers an Objective on this Scoreboard .
Parameters:
name
Name of the Objectivecriteria
Criteria type for the Objectivedisplay_name
Name displayed to players for the Objective.render_type
Manner of rendering the Objective
Returns:
A reference to the newly registered Objective.
clearSlot
void clearSlot(DisplaySlot slot)
Clears any objective in the specified slot.
Parameters:
slot
the slot to remove objectives
getEntries
std::vector<ScoreEntry> getEntries() const
Gets all entries tracked by this Scoreboard .
Returns:
A list of all tracked entries
getObjective
std::unique_ptr<Objective> getObjective(std::string name) const
Gets an Objective on this Scoreboard by name.
Parameters:
name
Name of the Objective
Returns:
the Objective or nullptr
if it does not exist
std::unique_ptr<Objective> getObjective(DisplaySlot slot) const
Gets the Objective currently displayed in a DisplaySlot on this Scoreboard .
Parameters:
slot
The DisplaySlot
Returns:
the Objective currently displayed or nullptr
if nothing is displayed in that DisplaySlot
getObjectives
std::vector<std::unique_ptr<Objective>> getObjectives() const
Gets all Objectives on this Scoreboard .
Returns:
A list of all Objectives on this Scoreboard
getObjectivesByCriteria
std::vector<std::unique_ptr<Objective>>
getObjectivesByCriteria(Criteria::Type criteria) const
Gets all Objectives of a Criteria on the Scoreboard .
Parameters:
criteria
Criteria type to search by
Returns:
A list of Objectives using the specified Criteria
getScores
std::vector<std::unique_ptr<Score>> getScores(ScoreEntry entry) const
Gets all scores for an entry on this Scoreboard .
Parameters:
entry
the entry whose scores are being retrieved
Returns:
a list of all scores tracked for the entry
resetScores
void resetScores(ScoreEntry entry)
Removes all scores for an entry on this Scoreboard .
Parameters:
entry
the entry to drop all current scores for