[][src]Struct basic_pathfinding::grid::Grid

pub struct Grid {
    pub tiles: Vec<Vec<i32>>,
    pub walkable_tiles: Vec<i32>,
    pub unstoppable_tiles: Vec<i32>,
    pub costs: HashMap<i32, i32>,
    pub extra_costs: HashMap<i32, HashMap<i32, i32>>,
    pub unstoppable_coords: HashMap<i32, HashMap<i32, bool>>,
    pub unwalkable_coords: HashMap<i32, HashMap<i32, bool>>,
    pub grid_type: GridType,
}

Fields

tiles: Vec<Vec<i32>>walkable_tiles: Vec<i32>unstoppable_tiles: Vec<i32>costs: HashMap<i32, i32>extra_costs: HashMap<i32, HashMap<i32, i32>>unstoppable_coords: HashMap<i32, HashMap<i32, bool>>unwalkable_coords: HashMap<i32, HashMap<i32, bool>>grid_type: GridType

Methods

impl Grid[src]

pub fn is_cardinal(&self) -> bool[src]

pub fn is_hex(&self) -> bool[src]

pub fn is_intercardinal(&self) -> bool[src]

pub fn in_grid(&self, x: i32, y: i32) -> bool[src]

pub fn is_coord_stoppable(&self, x: i32, y: i32) -> bool[src]

pub fn is_coord_walkable(&self, x: i32, y: i32) -> bool[src]

pub fn get_coord_cost(&self, x: i32, y: i32) -> i32[src]

pub fn get_adjacent(&self, coord: &Coord) -> Vec<Coord>[src]

Trait Implementations

impl Default for Grid[src]

impl Clone for Grid[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Grid[src]

impl Serialize for Grid[src]

impl<'de> Deserialize<'de> for Grid[src]

Auto Trait Implementations

impl Sync for Grid

impl Unpin for Grid

impl Send for Grid

impl UnwindSafe for Grid

impl RefUnwindSafe for Grid

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]