diff options
author | Griffin Smith <root@gws.fyi> | 2019-07-29T15·22-0400 |
---|---|---|
committer | Griffin Smith <root@gws.fyi> | 2019-07-29T15·22-0400 |
commit | 9db5fad2f900732d59f9714ac4517952d26506d7 (patch) | |
tree | 1f8de240a1f7ccecd37282b0f984e1d0a7d38000 /src/entities/character.rs | |
parent | 34b20b7786a8f6753bb449425772958e0285c385 (diff) |
Describe what you see when you walk over it
If the character walks over any number of entities, describe those entities to the character.
Diffstat (limited to 'src/entities/character.rs')
-rw-r--r-- | src/entities/character.rs | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/entities/character.rs b/src/entities/character.rs index b2da47609670..59d4d00a4b65 100644 --- a/src/entities/character.rs +++ b/src/entities/character.rs @@ -1,22 +1,17 @@ use crate::display; -use crate::entities::EntityID; use crate::types::{Position, Speed}; -use proptest_derive::Arbitrary; use std::io::{self, Write}; -use termion::cursor; const DEFAULT_SPEED: Speed = Speed(100); -#[derive(Debug, PartialEq, Eq, Arbitrary, Clone)] -pub struct Character { - pub id: Option<EntityID>, - - /// The position of the character, relative to the game - pub position: Position, - - pub o_name: Option<String>, +entity! { + pub struct Character { + pub o_name: Option<String>, + } } +static_description!(Character, "yourself"); + impl Character { pub fn new() -> Character { Character { @@ -46,8 +41,6 @@ impl Character { } } -entity!(Character); - impl display::Draw for Character { fn do_draw(&self, out: &mut Write) -> io::Result<()> { write!(out, "@") |