-use common::Point2D;
+use common::Point;
use core::render::Renderer;
use sprites::SpriteManager;
#[derive(Default)]
pub struct Level {
- pub gravity: Point2D<f64>,
- pub grid: Grid,
- walls: Vec<Vec<Point2D<isize>>>,
+ pub gravity: Point<f64>,
+ pub grid: Grid<bool>,
+ walls: Vec<Vec<Point<isize>>>,
}
impl Level {
- // pub fn new(gravity: Point2D<f64>) -> Self {
+ // pub fn new(gravity: Point<f64>) -> Self {
// let seed = std::time::SystemTime::now().duration_since(std::time::UNIX_EPOCH).unwrap().as_secs() as u32;
// let mut lvl = Level { gravity, grid: Grid::generate(seed, 10), iterations: 10, walls: vec!() };
// lvl.filter_regions();
////////// GRID ////////////////////////////////////////////////////////////////
#[derive(Default)]
-pub struct Grid {
+pub struct Grid<T> {
pub width: usize,
pub height: usize,
pub cell_size: usize,
- pub cells: Vec<Vec<bool>>,
+ pub cells: Vec<Vec<T>>,
}