pub struct Map {
pub width: usize,
pub height: usize,
pub tags: HashMap<String, String>,
pub entities: Vec<Unit>,
pub tiles: Vec<Tile>,
}Expand description
a map.
§Does not support serialization yet!
Fields§
§width: usize§height: usize§entities: Vec<Unit>§tiles: Vec<Tile>row major 2d array
(0, 0), (1, 0), (2, 0)
(0, 1), (1, 1), (2, 1)
(0, 2), (1, 2), (2, 2)Implementations§
Trait Implementations§
Source§impl Serializable for Map
serde map
impl Serializable for Map
serde map
Source§fn deserialize(buff: &mut DataRead<'_>) -> Result<Map, Self::ReadError>
fn deserialize(buff: &mut DataRead<'_>) -> Result<Map, Self::ReadError>
deserialize a map
note: does not deserialize all data
Source§fn serialize(&self, _: &mut DataWrite<'_>) -> Result<(), Self::WriteError>
fn serialize(&self, _: &mut DataWrite<'_>) -> Result<(), Self::WriteError>
serialize a map (todo) panics: always
type ReadError = ReadError
type WriteError = ()
Auto Trait Implementations§
impl Freeze for Map
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnsafeUnpin for Map
impl UnwindSafe for Map
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