From bd603e58152d0b84f72c5461012fab9046411fc8 Mon Sep 17 00:00:00 2001 From: Kelly Rauchenberger Date: Sat, 23 Feb 2019 17:52:58 -0500 Subject: active_ | entityView() -> entityRange() --- src/simulation.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/simulation.cpp') diff --git a/src/simulation.cpp b/src/simulation.cpp index 98687b6..326526f 100644 --- a/src/simulation.cpp +++ b/src/simulation.cpp @@ -94,8 +94,7 @@ void Simulation::tick( { // Control for (Entity& entity : - active_ | - entityView() | + entityRange() | views::isControllable() | views::isNotMoving()) { @@ -123,8 +122,7 @@ void Simulation::tick( vec2s lookPos = posInDir(entity.gridPos, lookDir); for (Entity& block : - active_ | - entityView() | + entityRange() | views::atGridPos(lookPos) | views::isNotMoving() | views::canBePushedBy(entity.colliderType) | @@ -171,14 +169,12 @@ void Simulation::tick( if (schedule_.step()) { for (Entity& entity : - active_ | - entityView() | + entityRange() | views::isScheduled() | views::isNotMoving()) { auto tracks = - active_ | - entityView() | + entityRange() | views::atGridPos(entity.gridPos) | views::isTrack(); @@ -214,9 +210,7 @@ void Simulation::tick( // Movement - for (Entity& entity : - active_ | - entityView()) + for (Entity& entity : entityRange()) { if (entity.moving) { @@ -331,8 +325,7 @@ bool Simulation::moveEntityOnGrid( // Can't move into a space that something else is already moving into. if (!ranges::empty( - active_ | - entityView() | + entityRange() | views::isMovingTo(shouldMoveTo) | views::isOnLayer(entity.layer))) { @@ -340,8 +333,7 @@ bool Simulation::moveEntityOnGrid( } for (Entity& block : - active_ | - entityView() | + entityRange() | views::atGridPos(shouldMoveTo) | views::isOnLayer(entity.layer)) { -- cgit 1.4.1