pub struct MapSaveState {
pub map_id: u32,
pub player_x: f32,
pub player_y: f32,
pub visited_chunks: HashSet<(i32, i32)>,
pub cleared_rooms: HashSet<u32>,
pub opened_chests: HashSet<u32>,
pub killed_enemies: HashSet<u64>,
pub world_time: f64,
pub save_version: u32,
}Fields§
§map_id: u32§player_x: f32§player_y: f32§visited_chunks: HashSet<(i32, i32)>§cleared_rooms: HashSet<u32>§opened_chests: HashSet<u32>§killed_enemies: HashSet<u64>§world_time: f64§save_version: u32Implementations§
Source§impl MapSaveState
impl MapSaveState
pub fn new(map_id: u32) -> Self
pub fn mark_chest_opened(&mut self, id: u32)
pub fn mark_enemy_killed(&mut self, id: u64)
pub fn mark_room_cleared(&mut self, id: u32)
pub fn mark_chunk_visited(&mut self, x: i32, y: i32)
pub fn is_room_cleared(&self, id: u32) -> bool
pub fn is_chest_opened(&self, id: u32) -> bool
pub fn is_enemy_killed(&self, id: u64) -> bool
pub fn is_chunk_visited(&self, x: i32, y: i32) -> bool
pub fn visited_chunk_count(&self) -> usize
pub fn advance_time(&mut self, dt: f64)
pub fn time_of_day_fraction(&self) -> f64
pub fn serialize_header(&self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for MapSaveState
impl RefUnwindSafe for MapSaveState
impl Send for MapSaveState
impl Sync for MapSaveState
impl Unpin for MapSaveState
impl UnsafeUnpin for MapSaveState
impl UnwindSafe for MapSaveState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.