summaryrefslogtreecommitdiff
path: root/src/systems/draw.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-03 16:36:52 +0100
committertroido <troido@protonmail.com>2020-02-03 16:36:52 +0100
commit19ce5319e2250b7b0e1a188f69d24de282a85a7f (patch)
tree2e51064f5e1dfa82304c558c56ab907255c953bd /src/systems/draw.rs
parentf0153eefd580ec443b380504303620a61f24630b (diff)
merged Draw into View; renamed Position to Pos
Diffstat (limited to 'src/systems/draw.rs')
-rw-r--r--src/systems/draw.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/systems/draw.rs b/src/systems/draw.rs
deleted file mode 100644
index 82400e3..0000000
--- a/src/systems/draw.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-
-use specs::{
- ReadStorage,
- Write,
- System,
- Join
-};
-
-use super::super::components::{
- Position,
- Visible
-};
-
-use super::super::resources::{
- TopView
-};
-
-
-pub struct Draw;
-impl <'a> System<'a> for Draw {
-
- type SystemData = (ReadStorage<'a, Position>, ReadStorage<'a, Visible>, Write<'a, TopView>);
-
- fn run(&mut self, (pos, vis, mut view): Self::SystemData) {
- view.cells.clear();
- for (pos, vis) in (&pos, &vis).join(){
- view.cells.entry(*pos).or_insert(Vec::new()).push(vis.clone());
- view.cells.get_mut(pos).unwrap().sort_by(|a, b| b.height.partial_cmp(&a.height).unwrap());
- }
- }
-}