pub struct Game { /* private fields */ }Implementations§
Source§impl Game
impl Game
pub fn new(map: Map, player: Player) -> Result<Self, InitError>
pub async fn load(path: &Path) -> Result<Self, LoadError>
pub async fn save(&self, path: &Path) -> Result<(), SaveError>
pub fn schedule_event(&mut self, event: Event, event_ticks: u32)
pub fn execute_events(&mut self) -> Result<(), ApplyError>
pub fn emit_meta_event(&mut self, meta_event: MetaEvent)
pub fn read_one_meta_event(&mut self) -> Option<MetaEvent>
pub fn map(&self) -> &Map
pub fn place_block( &mut self, point: CoordPair, block: PlaceableBlock, ) -> Result<(), AccessError>
pub fn player(&self) -> &Player
pub fn move_player_pointer( &mut self, direction: Direction, ) -> Result<(), MovePlayerError>
pub fn move_player_head( &mut self, direction: Direction, ) -> Result<(), MovePlayerError>
pub fn make_player_face( &mut self, direction: Direction, ) -> Result<(), MovePlayerError>
pub fn monster_registry(&self) -> &Registry
pub fn try_spawn_moster( &mut self, pos: MonsterPosition, ) -> Result<(), SpawnMonsterError>
pub fn vanish_monster(&mut self, id: Id) -> Result<(), VanishMonsterError>
pub fn try_move_monster( &mut self, id: Id, direction: Direction, ) -> Result<(), MoveMonsterError>
pub fn move_monster_head( &mut self, id: Id, direction: Direction, ) -> Result<(), MoveMonsterError>
pub fn make_monster_face( &mut self, id: Id, direction: Direction, ) -> Result<(), MoveMonsterError>
pub fn monster_attack(&mut self, id: Id) -> Result<(), MonsterAttackError>
pub fn monster_growl(&mut self, id: Id) -> Result<(), MonsterGrowlError>
pub fn monster_follow_player( &mut self, id: Id, speed: Coord, limit: u32, ) -> Result<(), MonsterFollowError>
pub fn damage_player(&mut self, amount: StatValue)
pub fn heal_player(&mut self, amount: StatValue)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Game
impl<'de> Deserialize<'de> for Game
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
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