pub struct ScoreboardContext {
scoreboard_players: FxHashMap<ScoreboardPlayerId, Rc<str>>,
pub scoreboards: FxHashMap<Scoreboard, Rc<str>>,
scoreboard_prefix: Rc<str>,
player_fmt_string: &'static str,
}
Expand description
Holds data about specific scoreboard contexts
Fields§
§scoreboard_players: FxHashMap<ScoreboardPlayerId, Rc<str>>
§scoreboards: FxHashMap<Scoreboard, Rc<str>>
§scoreboard_prefix: Rc<str>
§player_fmt_string: &'static str
Implementations§
source§impl ScoreboardContext
impl ScoreboardContext
sourcepub fn new(scoreboard_prefix: String, build_mode: BuildMode) -> Self
pub fn new(scoreboard_prefix: String, build_mode: BuildMode) -> Self
Creates a new scoreboard context with the default scoreboard name
sourcepub fn get_scoreboard(&mut self, scoreboard: Scoreboard) -> Rc<str>
pub fn get_scoreboard(&mut self, scoreboard: Scoreboard) -> Rc<str>
Returns the name of this scoreboard
Internally creates a scoreboard if it did not exist yet Clippy reports a false positive here
sourcepub fn get_scoreboard_player(&mut self, item_id: ItemId) -> Rc<str>
pub fn get_scoreboard_player(&mut self, item_id: ItemId) -> Rc<str>
Gets the scoreboard player that corresponds to this ItemId
sourcepub fn get_temporary_player(&mut self) -> ScoreboardPlayer
pub fn get_temporary_player(&mut self) -> ScoreboardPlayer
Makes a new scoreboard player and returns it as a ScoreboardPlayer
fn add_player(&mut self, player_id: ScoreboardPlayerId) -> Rc<str>
fn format_player(&self, id: usize) -> Rc<str>
fn format_scoreboard(&self, scoreboard: Scoreboard) -> Rc<str>
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for ScoreboardContext
impl !Send for ScoreboardContext
impl !Sync for ScoreboardContext
impl Unpin for ScoreboardContext
impl UnwindSafe for ScoreboardContext
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more