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
Implementations§
Source§impl Grid
impl Grid
pub fn is_cardinal(&self) -> bool
pub fn is_hex(&self) -> bool
pub fn is_intercardinal(&self) -> bool
pub fn in_grid(&self, x: i32, y: i32) -> bool
pub fn is_coord_stoppable(&self, x: i32, y: i32) -> bool
pub fn is_coord_walkable(&self, x: i32, y: i32) -> bool
pub fn get_coord_cost(&self, x: i32, y: i32) -> i32
pub fn get_adjacent(&self, coord: &Coord) -> Vec<Coord>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Grid
impl<'de> Deserialize<'de> for Grid
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Grid
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more