From 7dd148f8e0b371cb422f14dfe926e98642c41317 Mon Sep 17 00:00:00 2001 From: troido Date: Fri, 7 Feb 2020 19:47:49 +0100 Subject: can now load maps in the same format as the python version --- src/components.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'src/components.rs') 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} } } -- cgit