[−][src]Struct movingai::MovingAiMap
An immutable representation of a MovingAI map.
Methods
impl MovingAiMap
[src]
pub fn new(
map_type: String,
height: usize,
width: usize,
map: Vec<char>
) -> MovingAiMap
[src]
map_type: String,
height: usize,
width: usize,
map: Vec<char>
) -> MovingAiMap
Create a new MovingAIMap
object from basic components.
Arguments
map_type
: The type of map you are registering. Usuallyoctile
.height
: the height of the map.width
: the width of the map.map
: A vector representing the map in row-major order.
Panics
The new
call will panic id the size of the map vector is different
from heigth*width
.
Trait Implementations
impl Debug for MovingAiMap
[src]
impl Index<(usize, usize)> for MovingAiMap
[src]
impl Map2D<char> for MovingAiMap
[src]
fn width(&self) -> usize
[src]
fn height(&self) -> usize
[src]
fn get(&self, coords: Coords2D) -> &char
[src]
fn is_out_of_bound(&self, coords: Coords2D) -> bool
[src]
fn is_traversable(&self, tile: Coords2D) -> bool
[src]
fn is_traversable_from(&self, from: Coords2D, to: Coords2D) -> bool
[src]
fn coords(&self) -> CoordsIter
[src]
fn free_states(&self) -> usize
[src]
fn neighbors(&self, tile: Coords2D) -> Vec<Coords2D>
[src]
Auto Trait Implementations
impl RefUnwindSafe for MovingAiMap
impl Send for MovingAiMap
impl Sync for MovingAiMap
impl Unpin for MovingAiMap
impl UnwindSafe for MovingAiMap
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,