pub struct VectorGrid<ItemType> { /* private fields */ }Expand description
▣▦▥▩╱̅̅╲▜▄‾‾‾‾█╲▜█▀▀▀▀‾̅̅╲‾▄█▀▀▀▙╲▀▀▜▄▀▀‾̅̅╲‾▄█▀▀▀▙╲▜█▀▀▀▇‾╲
▧◤ ╱╲╱╲ ▜▄ █ ╲▜█▀▀▀ ╲▜ ╲ ▜▄ ╲▜ █╲▜█▄▄▛ ╲
╱╲╱╲╱╲__̲▜██__̲╲̲▜█▄▄▄▄_̲╲_̲▀▇▇▀_̲╲___̲▜▄__̲╲_̲▀▇▇▀_̲_̲╲̲▀█▄_̲▀▙_̲╲
╲╱╲╱╲̲╱_̲╱_̲╱_̲╱_̲╱ ▟███▙ ╱▟███▙ ╱ ▟▛ ╱ ▟██▇▄ ̲╱_̲╱_̲╱_̲╱_╱
╲╱╲̲╱_̲╱_̲╱_̲╱_̲╱ ▟▛ ▄▄ ╱▟█▄▄▛ ╱ ▟▛ ╱ ▟▛ ▟▛ ̲╱_̲╱_̲╱_̲╱_╱
╲̲╱_̲╱_̲╱_̲╱_̲╱__̲▜██▛_̲╱▟█_̲▜▙╱__▟▛__̲╱_̲▟██▇▀̲▀__̲╱_̲╱_̲╱_̲╱_╱
Implementations§
Source§impl<ItemType: VectorGridItemDisplay> VectorGrid<ItemType>
impl<ItemType: VectorGridItemDisplay> VectorGrid<ItemType>
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
Source§impl<ItemType: Default + Clone> VectorGrid<ItemType>
impl<ItemType: Default + Clone> VectorGrid<ItemType>
Sourcepub fn extend_dimension(
&mut self,
dimension: usize,
distance: usize,
amount: usize,
)
pub fn extend_dimension( &mut self, dimension: usize, distance: usize, amount: usize, )
Inserts an amount of layers filled with default items at a specific distance along a dimension
pub fn extend_inwards(&mut self, axis: usize, amount: usize)
pub fn extend_outwards(&mut self, axis: usize, amount: usize)
pub fn scale_to_encompace(&mut self, coordinate: &mut Coordinate)
pub fn extend(&mut self, amount: usize)
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn set_item(&mut self, at: Coordinate, to: ItemType)
pub fn set_item_if_contained(&mut self, at: Coordinate, to: ItemType)
Source§impl<ItemType: Clone> VectorGrid<ItemType>
impl<ItemType: Clone> VectorGrid<ItemType>
pub fn stamp(&mut self, stamp_grid: &VectorGrid<ItemType>, at: Coordinate)
Source§impl<ItemType: Clone + Default> VectorGrid<ItemType>
impl<ItemType: Clone + Default> VectorGrid<ItemType>
pub fn stamp_with_extend( &mut self, stamp_grid: &VectorGrid<ItemType>, at: Coordinate, )
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn from_vector(defined_shape: Vec<usize>, items: Vec<ItemType>) -> Self
Source§impl<ItemType: Default + Clone> VectorGrid<ItemType>
impl<ItemType: Default + Clone> VectorGrid<ItemType>
pub fn from_2d_array<const WIDTH: usize>(array: &[[ItemType; WIDTH]]) -> Self
pub fn new_fill(shape: impl Into<FullShape>) -> Self
Source§impl<ItemType: Copy> VectorGrid<ItemType>
impl<ItemType: Copy> VectorGrid<ItemType>
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn get_chunk_ref( &self, chunk_range: Vec<Range<usize>>, ) -> VectorGrid<&ItemType>
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn get(&self, at: &Coordinate) -> Option<&ItemType>
pub fn get_mut(&mut self, at: &Coordinate) -> Option<&mut ItemType>
Source§impl<ItemType: Clone + Default> VectorGrid<ItemType>
impl<ItemType: Clone + Default> VectorGrid<ItemType>
pub fn get_or_default(&self, at: &Coordinate) -> ItemType
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn iter_chunk<'a>( &'a self, shape: Vec<Range<usize>>, ) -> IterVectorGridChunk<'a, ItemType> ⓘ
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn step_sizes(&self) -> Vec<usize>
pub fn step_sizes_i(&self) -> Vec<isize>
pub fn is_inside_grid(&self, at: &Coordinate) -> bool
pub fn get_coordinate_index(&self, at: &Coordinate) -> usize
pub fn get_index_coordinate(&self, at: usize) -> Coordinate
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
Source§impl<ItemType> VectorGrid<ItemType>
impl<ItemType> VectorGrid<ItemType>
pub fn shape(&self) -> FullShape
pub fn defined_shape(&self) -> &DefinedShape
pub fn defined_shape_usize(&self) -> Vec<usize>
pub fn defined_shape_isize(&self) -> Vec<isize>
pub fn defined_shape_i32(&self) -> Vec<i32>
pub fn items(&self) -> &Vec<ItemType>
Trait Implementations§
Source§impl<ItemType: Clone> Clone for VectorGrid<ItemType>
impl<ItemType: Clone> Clone for VectorGrid<ItemType>
Source§fn clone(&self) -> VectorGrid<ItemType>
fn clone(&self) -> VectorGrid<ItemType>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<ItemType: Debug> Debug for VectorGrid<ItemType>
impl<ItemType: Debug> Debug for VectorGrid<ItemType>
Source§impl<'de, ItemType> Deserialize<'de> for VectorGrid<ItemType>where
ItemType: Deserialize<'de>,
impl<'de, ItemType> Deserialize<'de> for VectorGrid<ItemType>where
ItemType: Deserialize<'de>,
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
Source§impl<ItemType> Index<&Coordinate> for VectorGrid<ItemType>
impl<ItemType> Index<&Coordinate> for VectorGrid<ItemType>
Source§impl<ItemType> IndexMut<&Coordinate> for VectorGrid<ItemType>
impl<ItemType> IndexMut<&Coordinate> for VectorGrid<ItemType>
Auto Trait Implementations§
impl<ItemType> Freeze for VectorGrid<ItemType>
impl<ItemType> RefUnwindSafe for VectorGrid<ItemType>where
ItemType: RefUnwindSafe,
impl<ItemType> Send for VectorGrid<ItemType>where
ItemType: Send,
impl<ItemType> Sync for VectorGrid<ItemType>where
ItemType: Sync,
impl<ItemType> Unpin for VectorGrid<ItemType>where
ItemType: Unpin,
impl<ItemType> UnwindSafe for VectorGrid<ItemType>where
ItemType: UnwindSafe,
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