make variable inventory slots
This commit is contained in:
@@ -72,15 +72,21 @@ impl Potion {
|
||||
was_collected: false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_health(&self) -> usize {
|
||||
self.health
|
||||
}
|
||||
}
|
||||
|
||||
impl Artifact for Potion {
|
||||
fn get_representation(&self) -> (&str, Color) {
|
||||
("P", Color::Green)
|
||||
}
|
||||
|
||||
fn get_immutable_position(&self) -> &Position {
|
||||
&self.position
|
||||
}
|
||||
|
||||
fn collect(&mut self, player: &mut Player, messages: &mut Vec<String>) {
|
||||
// only consume potion of the player can gain at least one health point
|
||||
if !player.is_healthy() {
|
||||
@@ -105,8 +111,3 @@ impl Artifact for Potion {
|
||||
self.was_collected
|
||||
}
|
||||
}
|
||||
impl Potion {
|
||||
pub fn get_health(&self) -> usize {
|
||||
self.health
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user