pub struct Game { /* private fields */ }Implementations§
Source§impl Game
impl Game
pub fn update_time_step() -> Duration
pub fn draw_time_step() -> Duration
pub fn new() -> AppResult<Self>
pub fn top_heros(&self) -> &Vec<(PlayerId, String, usize, Duration)>
pub fn top_minotaurs(&self) -> &Vec<(PlayerId, String, usize, usize)>
pub fn minotaurs_in_maze(&self, maze_id: usize) -> usize
pub fn alarm_level(&self, hero_id: &PlayerId) -> (AlarmLevel, usize)
pub fn add_player(&mut self, player_id: PlayerId, name: &str)
pub fn remove_player(&mut self, player_id: &PlayerId)
pub fn get_hero(&self, id: &PlayerId) -> Option<&Hero>
pub fn get_minotaur(&self, id: &PlayerId) -> Option<&Minotaur>
pub fn get_maze(&self, id: usize) -> &Maze
pub fn number_of_players(&self) -> usize
pub fn update(&mut self)
pub fn image_char_overrides( &self, player_id: PlayerId, image: &RgbaImage, ) -> AppResult<HashMap<(u32, u32), char>>
pub fn draw(&self, player_id: PlayerId) -> AppResult<RgbaImage>
pub fn handle_command(&mut self, command: &GameCommand, hero_id: PlayerId)
Auto Trait Implementations§
impl Freeze for Game
impl RefUnwindSafe for Game
impl Send for Game
impl Sync for Game
impl Unpin for Game
impl UnsafeUnpin for Game
impl UnwindSafe for Game
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more