Struct movingai::MovingAiMap
[−]
[src]
pub struct MovingAiMap { /* fields omitted */ }
An immutable representation of a MovingAI map.
Methods
impl MovingAiMap
[src]
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 Map2D<char> for MovingAiMap
[src]
fn get_width(&self) -> usize
[src]
Every Map2D must have a width.
fn get_height(&self) -> usize
[src]
Every Map2D must have an height.
fn get_cell(&self, coords: Coords2D) -> &char
[src]
In every Map2D must be possible to get an item. 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
fn coords_iter(&self) -> Map2DCoordsIter
[src]
Return an iterator returning all the coordinates in the map in row-major order. Read more
fn free_states(&self) -> u32
[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.