summaryrefslogtreecommitdiff
path: root/src/systems/view.rs
diff options
context:
space:
mode:
authortroido <troido@protonmail.com>2020-02-08 18:50:58 +0100
committertroido <troido@protonmail.com>2020-02-08 18:50:58 +0100
commit3ebe9e6f792a0457c6f3b37b6e9d92c83f8694e2 (patch)
treeaaa81d23a4816ebecacc64593419d3d811b7283b /src/systems/view.rs
parent7dfc7956a7c2df9a1df3ea0b32e0c3d2036fa3ce (diff)
don't rebuild the ground each step
Diffstat (limited to 'src/systems/view.rs')
-rw-r--r--src/systems/view.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/systems/view.rs b/src/systems/view.rs
index fec5ee7..12b5f78 100644
--- a/src/systems/view.rs
+++ b/src/systems/view.rs
@@ -16,7 +16,7 @@ use specs::{
};
use super::super::pos::Pos;
-use super::super::components::{Visible, Player, Position};
+use super::super::components::{Visible, Player, Position, New};
use super::super::resources::{Size, Output};
use super::super::worldmessages::{WorldMessage, WorldUpdate, FieldMessage};
@@ -29,8 +29,8 @@ pub struct View {
}
impl <'a> System<'a> for View {
- type SystemData = (ReadStorage<'a, Position>, ReadStorage<'a, Visible>, Read<'a, Size>, WriteStorage<'a, Player>, Write<'a, Output>);
- fn run(&mut self, (positions, visible, size, mut players, mut output): Self::SystemData) {
+ type SystemData = (ReadStorage<'a, Position>, ReadStorage<'a, Visible>, Read<'a, Size>, WriteStorage<'a, Player>, Write<'a, Output>, ReadStorage<'a, New>);
+ fn run(&mut self, (positions, visible, size, mut players, mut output, _new): Self::SystemData) {
let mut cells: HashMap<Pos, Vec<Visible>> = HashMap::new();
for (pos, vis) in (&positions, &visible).join(){