diff options
| author | troido <troido@protonmail.com> | 2020-02-07 19:47:49 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-07 19:47:49 +0100 |
| commit | 7dd148f8e0b371cb422f14dfe926e98642c41317 (patch) | |
| tree | 5fcc1d564f86a18632819ce27284260d6b542973 /src/components.rs | |
| parent | 940b1c762bb98a56dddc6e3e7f208867abb3ebe5 (diff) | |
can now load maps in the same format as the python version
Diffstat (limited to 'src/components.rs')
| -rw-r--r-- | src/components.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/components.rs b/src/components.rs index 7517af9..34dbe97 100644 --- a/src/components.rs +++ b/src/components.rs @@ -2,6 +2,7 @@ use specs::{ DenseVecStorage, VecStorage, + HashMapStorage, FlaggedStorage, Component }; @@ -41,13 +42,17 @@ pub struct Controller(pub Control); pub struct Blocking; #[derive(Component, Debug, Clone)] -pub struct Played { +pub struct Floor; + +#[derive(Component, Debug, Clone)] +#[storage(HashMapStorage)] +pub struct Player { pub name: String, pub is_new: bool } -impl Played { - pub fn new(name: String) -> Played { - Played{name, is_new: true} +impl Player { + pub fn new(name: String) -> Self { + Self{name, is_new: true} } } |
