diff options
| author | troido <troido@protonmail.com> | 2020-02-07 20:28:01 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-07 20:28:01 +0100 |
| commit | fa81f03509aa1300613c62e3a7b32db1183cd5c8 (patch) | |
| tree | 0258c669ea0a81b8e98a4b5fc14cc5139d49bedc /src/systems/makefloor.rs | |
| parent | 8be2749edf97b200281a2c67f97ed8835f5c6d88 (diff) | |
added floors
Diffstat (limited to 'src/systems/makefloor.rs')
| -rw-r--r-- | src/systems/makefloor.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/systems/makefloor.rs b/src/systems/makefloor.rs index 209d965..8b550bc 100644 --- a/src/systems/makefloor.rs +++ b/src/systems/makefloor.rs @@ -11,17 +11,17 @@ use specs::{ use super::super::components::Position; use super::super::resources::{ - Floor + Ground }; pub struct MakeFloor; impl <'a> System<'a> for MakeFloor { - type SystemData = (Entities<'a>, Write<'a, Floor>, ReadStorage<'a, Position>); - fn run(&mut self, (entities, mut floor, positions): Self::SystemData) { - floor.cells.clear(); + type SystemData = (Entities<'a>, Write<'a, Ground>, ReadStorage<'a, Position>); + fn run(&mut self, (entities, mut ground, positions): Self::SystemData) { + ground.cells.clear(); for (ent, pos) in (&entities, &positions).join() { - floor.cells.entry(pos.pos).or_insert(Vec::new()).push(ent); + ground.cells.entry(pos.pos).or_insert(Vec::new()).push(ent); } } } |
