Class endstone::Scoreboard¶
ClassList > endstone > Scoreboard
Represents a scoreboard.
#include <endstone/scoreboard/scoreboard.h>
Inherits the following classes: std::enable_shared_from_this< Scoreboard >
Public Functions¶
| Type | Name |
|---|---|
| virtual std::unique_ptr< Objective > | addObjective (std::string name, Criteria::Type criteria) = 0 Registers an Objective on thisScoreboard . |
| virtual std::unique_ptr< Objective > | addObjective (std::string name, Criteria::Type criteria, std::string display_name) = 0 Registers an Objective on thisScoreboard . |
| virtual std::unique_ptr< Objective > | addObjective (std::string name, Criteria::Type criteria, std::string display_name, RenderType render_type) = 0 Registers an Objective on thisScoreboard . |
| virtual void | clearSlot (DisplaySlot slot) = 0 Clears any objective in the specified slot. |
| virtual std::vector< ScoreEntry > | getEntries () const = 0 Gets all entries tracked by this Scoreboard . |
| virtual std::unique_ptr< Objective > | getObjective (std::string name) const = 0 Gets an Objective on thisScoreboard by name. |
| virtual std::unique_ptr< Objective > | getObjective (DisplaySlot slot) const = 0 Gets the Objective currently displayed in a DisplaySlot on thisScoreboard . |
| virtual std::vector< std::unique_ptr< Objective > > | getObjectives () const = 0 Gets all Objectives on this Scoreboard . |
| virtual std::vector< std::unique_ptr< Objective > > | getObjectivesByCriteria (Criteria::Type criteria) const = 0 Gets all Objectives of a Criteria on theScoreboard . |
| virtual std::vector< std::unique_ptr< Score > > | getScores (ScoreEntry entry) const = 0 Gets all scores for an entry on this Scoreboard . |
| virtual void | resetScores (ScoreEntry entry) = 0 Removes all scores for an entry on this Scoreboard . |
| virtual | ~Scoreboard () = default |
Public Functions Documentation¶
function addObjective [⅓]¶
Registers an Objective on thisScoreboard .
virtual std::unique_ptr< Objective > endstone::Scoreboard::addObjective (
std::string name,
Criteria::Type criteria
) = 0
Parameters:
Returns:
A reference to the newly registered Objective, or nullptr if an objective by that name already exists.
function addObjective [⅔]¶
Registers an Objective on thisScoreboard .
virtual std::unique_ptr< Objective > endstone::Scoreboard::addObjective (
std::string name,
Criteria::Type criteria,
std::string display_name
) = 0
Parameters:
nameName of the ObjectivecriteriaCriteria type for the Objectivedisplay_nameName displayed to players for the Objective.
Returns:
A reference to the newly registered Objective, or nullptr if an objective by that name already exists.
function addObjective [3/3]¶
Registers an Objective on thisScoreboard .
virtual std::unique_ptr< Objective > endstone::Scoreboard::addObjective (
std::string name,
Criteria::Type criteria,
std::string display_name,
RenderType render_type
) = 0
Parameters:
nameName of the ObjectivecriteriaCriteria type for the Objectivedisplay_nameName displayed to players for the Objective.render_typeManner of rendering the Objective
Returns:
A reference to the newly registered Objective, or nullptr if an objective by that name already exists.
function clearSlot¶
Clears any objective in the specified slot.
Parameters:
slotthe slot to remove objectives
function getEntries¶
Gets all entries tracked by this Scoreboard .
Returns:
A list of all tracked entries
function getObjective [½]¶
Gets an Objective on thisScoreboard by name.
virtual std::unique_ptr< Objective > endstone::Scoreboard::getObjective (
std::string name
) const = 0
Parameters:
nameName of the Objective
Returns:
the Objective or nullptr if it does not exist
function getObjective [2/2]¶
Gets the Objective currently displayed in a DisplaySlot on thisScoreboard .
virtual std::unique_ptr< Objective > endstone::Scoreboard::getObjective (
DisplaySlot slot
) const = 0
Parameters:
slotThe DisplaySlot
Returns:
the Objective currently displayed or nullptr if nothing is displayed in that DisplaySlot
function getObjectives¶
Gets all Objectives on this Scoreboard .
virtual std::vector< std::unique_ptr< Objective > > endstone::Scoreboard::getObjectives () const = 0
Returns:
A list of all Objectives on this Scoreboard
function getObjectivesByCriteria¶
Gets all Objectives of a Criteria on theScoreboard .
virtual std::vector< std::unique_ptr< Objective > > endstone::Scoreboard::getObjectivesByCriteria (
Criteria::Type criteria
) const = 0
Parameters:
criteriaCriteria type to search by
Returns:
A list of Objectives using the specified Criteria
function getScores¶
Gets all scores for an entry on this Scoreboard .
virtual std::vector< std::unique_ptr< Score > > endstone::Scoreboard::getScores (
ScoreEntry entry
) const = 0
Parameters:
entrythe entry whose scores are being retrieved
Returns:
a list of all scores tracked for the entry
function resetScores¶
Removes all scores for an entry on this Scoreboard .
Parameters:
entrythe entry to drop all current scores for
function ~Scoreboard¶
The documentation for this class was generated from the following file include/endstone/scoreboard/scoreboard.h