diff options
Diffstat (limited to 'dungeon/src/lib.rs')
| -rw-r--r-- | dungeon/src/lib.rs | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/dungeon/src/lib.rs b/dungeon/src/lib.rs index 39d7c60..8119119 100644 --- a/dungeon/src/lib.rs +++ b/dungeon/src/lib.rs @@ -2,6 +2,7 @@ //! interacting with a `Dungeon` and its components. mod bsp; +mod enemy; mod entity; mod map; mod pos; @@ -11,12 +12,15 @@ pub use entity::*; pub use map::*; pub use pos::*; +use crate::enemy::{Enemy, EnemyType}; + /// The `Dungeon` type represents the game state of the /// dungeon crawler. #[derive(Clone, Debug, PartialEq)] pub struct Dungeon { pub floor: Floor, pub player: Player, + pub enemies: Vec<Enemy>, } impl Dungeon { /// Creates a new `Dungeon`. @@ -65,6 +69,16 @@ impl From<Floor> for Dungeon { // TODO: initalize rest of game state - Self { floor, player } + // TODO: How will we randomize enemy type/number per floor? + let enemies = vec![Enemy::new( + EnemyType::Zombie, + Pos::new(player.entity.pos.x() + 4, player.entity.pos.y()).unwrap(), + )]; + + Self { + floor, + player, + enemies, + } } } |