Extract constants and make monsters variable per level

This commit is contained in:
2024-10-26 17:00:51 +02:00
parent e490011b4e
commit b833b43c7c
6 changed files with 94 additions and 40 deletions

View File

@@ -6,10 +6,8 @@ use rand::Rng;
use crate::artifacts::Artifact;
#[cfg(test)]
use crate::artifacts::{Chest, Potion};
use crate::level_generator::ROOMS_HORIZONTAL;
use crate::level_generator::ROOMS_VERTICAL;
use crate::level_generator::ROOM_HEIGHT;
use crate::level_generator::ROOM_WIDTH;
use crate::constants::LEVEL_HEIGHT;
use crate::constants::LEVEL_WIDTH;
use crate::monster::Monster;
#[cfg(test)]
use crate::monster::{Orc, Rat};
@@ -17,9 +15,6 @@ use crate::player::Player;
use crate::position::HasPosition;
use crate::position::Position;
pub const LEVEL_WIDTH: usize = 1 + ROOMS_VERTICAL * ROOM_WIDTH;
pub const LEVEL_HEIGHT: usize = 1 + ROOMS_HORIZONTAL * ROOM_HEIGHT;
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum StructureElement {
Start,