Struct mindus::Map

source ·
pub struct Map<'l> {
    pub width: usize,
    pub height: usize,
    pub tags: HashMap<String, String>,
    pub tiles: Vec<Tile<'l>>,
}
Expand description

Fields§

§width: usize§height: usize§tags: HashMap<String, String>§tiles: Vec<Tile<'l>>

row major 2d array

(0, 0), (1, 0), (2, 0)
(0, 1), (1, 1), (2, 1)
(0, 2), (1, 2), (2, 2)

Implementations§

source§

impl<'l> Map<'l>

source

pub fn new(width: usize, height: usize, tags: HashMap<String, String>) -> Self

Trait Implementations§

source§

impl<'l> Debug for Map<'l>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'l> Index<usize> for Map<'l>

§

type Output = Tile<'l>

The returned type after indexing.
source§

fn index(&self, index: usize) -> &Self::Output

Performs the indexing (container[index]) operation. Read more
source§

impl<'l> IndexMut<usize> for Map<'l>

source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Performs the mutable indexing (container[index]) operation. Read more
source§

impl Renderable for Map<'_>

source§

unsafe fn render(&self) -> RgbImage

Draws a map

Safety

UB if called before warmup

source§

impl<'l> Serializer<Map<'l>> for MapSerializer<'l>

source§

fn deserialize( &mut self, buff: &mut DataRead<'_> ) -> Result<Map<'l>, Self::ReadError>

deserialize a map

notes:

  • does not deserialize data
  • does not deserialize entities
source§

fn serialize( &mut self, _: &mut DataWrite<'_>, _: &Map<'_> ) -> Result<(), Self::WriteError>

serialize a map (todo) panics: always

§

type ReadError = ReadError

§

type WriteError = ()

Auto Trait Implementations§

§

impl<'l> !RefUnwindSafe for Map<'l>

§

impl<'l> Send for Map<'l>

§

impl<'l> Sync for Map<'l>

§

impl<'l> Unpin for Map<'l>

§

impl<'l> !UnwindSafe for Map<'l>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.