Skip to content

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 Result< std::unique_ptr< Objective > > addObjective (std::string name, Criteria::Type criteria) = 0
Registers an Objective on thisScoreboard .
virtual Result< std::unique_ptr< Objective > > addObjective (std::string name, Criteria::Type criteria, std::string display_name) = 0
Registers an Objective on thisScoreboard .
virtual Result< 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 Result< std::unique_ptr< Objective > > endstone::Scoreboard::addObjective (
    std::string name,
    Criteria::Type criteria
) = 0

Parameters:

Returns:

A reference to the newly registered Objective.


function addObjective [⅔]

Registers an Objective on thisScoreboard .

virtual Result< std::unique_ptr< Objective > > endstone::Scoreboard::addObjective (
    std::string name,
    Criteria::Type criteria,
    std::string display_name
) = 0

Parameters:

Returns:

A reference to the newly registered Objective.


function addObjective [3/3]

Registers an Objective on thisScoreboard .

virtual Result< std::unique_ptr< Objective > > endstone::Scoreboard::addObjective (
    std::string name,
    Criteria::Type criteria,
    std::string display_name,
    RenderType render_type
) = 0

Parameters:

Returns:

A reference to the newly registered Objective.


function clearSlot

Clears any objective in the specified slot.

virtual void endstone::Scoreboard::clearSlot (
    DisplaySlot slot
) = 0

Parameters:

  • slot the slot to remove objectives

function getEntries

Gets all entries tracked by this Scoreboard .

virtual std::vector< ScoreEntry > endstone::Scoreboard::getEntries () const = 0

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:

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:

  • slot The 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:

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:

  • entry the 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 .

virtual void endstone::Scoreboard::resetScores (
    ScoreEntry entry
) = 0

Parameters:

  • entry the entry to drop all current scores for

function ~Scoreboard

virtual endstone::Scoreboard::~Scoreboard () = default


The documentation for this class was generated from the following file include/endstone/scoreboard/scoreboard.h