diff options
Diffstat (limited to 'dungeon')
| -rw-r--r-- | dungeon/src/entity.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/dungeon/src/entity.rs b/dungeon/src/entity.rs index 4ea6725..02184a9 100644 --- a/dungeon/src/entity.rs +++ b/dungeon/src/entity.rs @@ -2,6 +2,12 @@ use crate::{Direction, FPos, Pos, const_pos}; +/// `PLAYER_FULL_HEALTH` is the starting health of the player entity +pub const PLAYER_FULL_HEALTH: u32 = 10; + +/// `PLAYER_INVENTORY_SIZE` is the maximum size of the inventory +pub const PLAYER_INVENTORY_SIZE: usize = 5; + /// The `Item` type represents any item an entity may be using #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] pub enum Item { @@ -46,7 +52,7 @@ impl Entity { /// let pos = Pos::new(0, 0).unwrap(); /// let dir = Direction::North; /// let kind = EntityKind::Player; - /// let health = Some(100); + /// let health = Some(10); /// let entity = Entity::new(pos, dir, kind, health); /// ``` #[must_use] @@ -80,7 +86,7 @@ impl Entity { pub const fn player(pos: Pos) -> Self { let dir = Direction::East; let kind = EntityKind::Player; - let health = Some(100); + let health = Some(PLAYER_FULL_HEALTH); Self::new(pos, dir, kind, health) } } |