Class endstone::BossBar¶
ClassList > endstone > BossBar
Represents a boss bar that is displayed to players.
#include <endstone/boss/boss_bar.h>
Public Functions¶
Type | Name |
---|---|
virtual void | addFlag (BarFlag flag) = 0 Add an optional flag to this boss bar. |
virtual void | addPlayer (Player & player) = 0 Adds the player to this boss bar causing it to display on their screen. |
virtual BarColor | getColor () const = 0 Returns the color of this boss bar. |
virtual std::vector< Player * > | getPlayers () const = 0 Returns all players viewing this boss bar. |
virtual float | getProgress () const = 0 Returns the progress of the bar between 0.0 and 1.0. |
virtual BarStyle | getStyle () const = 0 Returns the style of this boss bar. |
virtual std::string | getTitle () const = 0 Returns the title of this boss bar. |
virtual bool | hasFlag (BarFlag flag) const = 0 Returns whether this boss bar has the passed flag set. |
virtual bool | isVisible () const = 0 Return if the boss bar is displayed to attached players. |
virtual void | removeAll () = 0 Removes all players from this boss bar. |
virtual void | removeFlag (BarFlag flag) = 0 Remove an existing flag on this boss bar. |
virtual void | removePlayer (Player & player) = 0 Removes the player from this boss bar causing it to be removed from their screen. |
virtual void | setColor (BarColor color) = 0 Sets the color of this boss bar. |
virtual Result< void > | setProgress (float progress) = 0 Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full) |
virtual void | setStyle (BarStyle style) = 0 Sets the bar style of this boss bar. |
virtual void | setTitle (std::string title) = 0 Sets the title of this boss bar. |
virtual void | setVisible (bool visible) = 0 Set if the boss bar is displayed to attached players. |
virtual | ~BossBar () = default |
Public Functions Documentation¶
function addFlag¶
Add an optional flag to this boss bar.
Parameters:
flag
an optional flag to set on the boss bar.
function addPlayer¶
Adds the player to this boss bar causing it to display on their screen.
Parameters:
player
the player to add
function getColor¶
Returns the color of this boss bar.
Returns:
the color of the bar
function getPlayers¶
Returns all players viewing this boss bar.
Returns:
a list of players
function getProgress¶
Returns the progress of the bar between 0.0 and 1.0.
Returns:
the progress of the bar
function getStyle¶
Returns the style of this boss bar.
Returns:
the style of the bar.
function getTitle¶
Returns the title of this boss bar.
Returns:
the title of the bar
function hasFlag¶
Returns whether this boss bar has the passed flag set.
Parameters:
flag
the flag to check.
Returns:
whether it has the flag.
function isVisible¶
Return if the boss bar is displayed to attached players.
Returns:
visible status
function removeAll¶
function removeFlag¶
Remove an existing flag on this boss bar.
Parameters:
flag
the existing flag to remove.
function removePlayer¶
Removes the player from this boss bar causing it to be removed from their screen.
Parameters:
player
the player to remove
function setColor¶
Sets the color of this boss bar.
Parameters:
color
the color of the bar
function setProgress¶
Sets the progress of the bar. Values should be between 0.0 (empty) and 1.0 (full)
Parameters:
progress
the progress of the bar
function setStyle¶
Sets the bar style of this boss bar.
Parameters:
style
the style of the bar.
function setTitle¶
Sets the title of this boss bar.
Parameters:
title
the title of the bar
function setVisible¶
Set if the boss bar is displayed to attached players.
Parameters:
visible
visible status
function ~BossBar¶
The documentation for this class was generated from the following file include/endstone/boss/boss_bar.h