diff --git a/src/map.rs b/src/map.rs new file mode 100644 index 0000000..de927fe --- /dev/null +++ b/src/map.rs @@ -0,0 +1,25 @@ +use crate::prelude::*; + +#[derive(Clone, Copy)] +pub enum Tile { + Floor, + Wall, +} + +pub struct Map { + pub tiles: Vec, +} + +impl Map { + pub fn index(&self, x: i32, y: i32) -> usize { + ((y * MAP_HEIGHT) + x) as usize + } +} + +impl Default for Map { + fn default() -> Self { + Self { + tiles: vec![Tile::Floor; NUM_TILES], + } + } +}