Cleanup
This commit is contained in:
parent
677acf771a
commit
ee1f11cd1f
|
@ -12,7 +12,7 @@ impl Game<'_> {
|
||||||
pub fn new(p: &mut Player) -> Game {
|
pub fn new(p: &mut Player) -> Game {
|
||||||
let mut v: Vec<Level> = Vec::with_capacity(LEVELS);
|
let mut v: Vec<Level> = Vec::with_capacity(LEVELS);
|
||||||
for _ in 0..LEVELS {
|
for _ in 0..LEVELS {
|
||||||
let mut l = Level::new();
|
let l = Level::new();
|
||||||
v.push(l);
|
v.push(l);
|
||||||
}
|
}
|
||||||
Game {
|
Game {
|
||||||
|
|
|
@ -5,7 +5,7 @@ pub const LEVEL_WIDTH: usize = 50;
|
||||||
pub const LEVEL_HEIGHT: usize = 25;
|
pub const LEVEL_HEIGHT: usize = 25;
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
enum StructureElement {
|
pub enum StructureElement {
|
||||||
Wall,
|
Wall,
|
||||||
Floor,
|
Floor,
|
||||||
StairDown,
|
StairDown,
|
||||||
|
@ -13,7 +13,7 @@ enum StructureElement {
|
||||||
Unknown,
|
Unknown,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Copy, Clone, Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
pub struct Level {
|
pub struct Level {
|
||||||
structure: [[StructureElement; LEVEL_HEIGHT]; LEVEL_WIDTH],
|
structure: [[StructureElement; LEVEL_HEIGHT]; LEVEL_WIDTH],
|
||||||
discovered: [[bool; LEVEL_HEIGHT]; LEVEL_WIDTH],
|
discovered: [[bool; LEVEL_HEIGHT]; LEVEL_WIDTH],
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
use crate::game::Game;
|
use crate::game::Game;
|
||||||
use crate::level::Level;
|
|
||||||
use crate::player::Player;
|
use crate::player::Player;
|
||||||
|
|
||||||
mod game;
|
mod game;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use std::cmp::{max, min};
|
use std::cmp::max;
|
||||||
|
|
||||||
use crate::position::Position;
|
use crate::position::Position;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue