Struct movingai::MovingAiMap
[−]
[src]
pub struct MovingAiMap { /* fields omitted */ }
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]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Map2D<char> for MovingAiMap
[src]
fn width(&self) -> usize
[src]
Every Map2D must have a width.
fn height(&self) -> usize
[src]
Every Map2D must have an height.
fn get(&self, coords: Coords2D) -> &char
[src]
In every Map2D must be possible to get a tile. Read more
fn is_out_of_bound(&self, coords: Coords2D) -> bool
[src]
Check if the given coordinates are out of bound. Read more
fn is_traversable(&self, tile: Coords2D) -> bool
[src]
Check if a tile in the map can be traversed. Read more
fn is_traversable_from(&self, from: Coords2D, to: Coords2D) -> bool
[src]
Check if a tile in the map can be traversed coming from the from
tile. Read more
ⓘImportant traits for CoordsIterfn coords(&self) -> CoordsIter
[src]
ⓘImportant traits for CoordsIter
Return an iterator returning all the coordinates in the map in row-major order. Read more
fn free_states(&self) -> usize
[src]
Return the number of free states of a map. Read more
fn neighbors(&self, tile: Coords2D) -> Vec<Coords2D>
[src]
Return the list of accessible neighbors of a tile.