diff options
Diffstat (limited to 'dungeon/src/entity.rs')
| -rw-r--r-- | dungeon/src/entity.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 02184a9..5f0425f 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -21,6 +21,7 @@ pub enum Item { pub enum EntityKind { /// The main player Player, + Enemy, /// An item (not in an inventory) on the floor of the dungeon Item(Item), } @@ -89,6 +90,12 @@ impl Entity { let health = Some(PLAYER_FULL_HEALTH); Self::new(pos, dir, kind, health) } + + pub const fn enemy(pos: Pos, health: u32) -> Self { + let dir = Direction::East; + let kind = EntityKind::Enemy; + Self::new(pos, dir, kind, Some(health)) + } } /// The `Player` type represents the main player entity |