nd_vector 0.1.0

[WIP] Lengthen! Shrink! Iterate! Scale! Twist and turn to your imagination along any dimension on a vector!
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::{usage_types::coordinates::Coordinate, VectorGrid};

impl<ItemType> VectorGrid<ItemType> {
    pub fn set_item(&mut self, at: Coordinate, to: ItemType) {
        self[&at] = to
    }

    pub fn set_item_if_contained(&mut self, at: Coordinate, to: ItemType) {
        if self.is_inside_grid(&at) {
            self[&at] = to
        }
    }
}