diff --git a/src/game.rs b/src/game.rs index 84ce0ee..6df22dd 100644 --- a/src/game.rs +++ b/src/game.rs @@ -12,7 +12,7 @@ impl Game<'_> { pub fn new(p: &mut Player) -> Game { let mut v: Vec = Vec::with_capacity(LEVELS); for _ in 0..LEVELS { - let mut l = Level::new(); + let l = Level::new(); v.push(l); } Game { diff --git a/src/level.rs b/src/level.rs index 3f52b95..a378320 100644 --- a/src/level.rs +++ b/src/level.rs @@ -5,7 +5,7 @@ pub const LEVEL_WIDTH: usize = 50; pub const LEVEL_HEIGHT: usize = 25; #[derive(Copy, Clone, Debug, PartialEq)] -enum StructureElement { +pub enum StructureElement { Wall, Floor, StairDown, @@ -13,7 +13,7 @@ enum StructureElement { Unknown, } -#[derive(Copy, Clone, Debug, PartialEq)] +#[derive(Debug, PartialEq)] pub struct Level { structure: [[StructureElement; LEVEL_HEIGHT]; LEVEL_WIDTH], discovered: [[bool; LEVEL_HEIGHT]; LEVEL_WIDTH], diff --git a/src/main.rs b/src/main.rs index f2d6408..75796ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,4 @@ use crate::game::Game; -use crate::level::Level; use crate::player::Player; mod game; diff --git a/src/monster.rs b/src/monster.rs index 4ab207c..cd9e0f5 100644 --- a/src/monster.rs +++ b/src/monster.rs @@ -1,4 +1,4 @@ -use std::cmp::{max, min}; +use std::cmp::max; use crate::position::Position;