summaryrefslogtreecommitdiff
path: root/src/game/game.cpp
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-12-14 12:43:17 +0100
committerPaweł Redman <pawel.redman@gmail.com>2017-12-14 12:43:17 +0100
commit12143c33141a9c35e8eb01609062655f560b4bc1 (patch)
treea215c1cffa153c2cb8b32214fe74bbd99e99c239 /src/game/game.cpp
parent171e12893048f29bddccf2de183a1dec2f0a00fa (diff)
Get rid of all the time parameters in game.
Diffstat (limited to 'src/game/game.cpp')
-rw-r--r--src/game/game.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/game/game.cpp b/src/game/game.cpp
index 5643b3a..c2c2c19 100644
--- a/src/game/game.cpp
+++ b/src/game/game.cpp
@@ -11,21 +11,21 @@ void state_t::start(void)
world.generator = worldgen;
- human = new human_t;
+ human = new human_t(this);
human->place(&world, v2f_t(0.5, 0.5));
units.insert(human);
- human = new human_t;
+ human = new human_t(this);
human->place(&world, v2f_t(1.5, 0.5));
units.insert(human);
- human = new human_t;
+ human = new human_t(this);
human->place(&world, v2f_t(2.5, 0.5));
units.insert(human);
- alien = new alien_t;
+ alien = new alien_t(this);
alien->place(&world, v2f_t(15.5, -2.5));
- alien = new alien_t;
+ alien = new alien_t(this);
alien->place(&world, v2f_t(14.5, -2.5));
- alien = new alien_t;
+ alien = new alien_t(this);
alien->place(&world, v2f_t(13.5, -2.5));
}
@@ -70,7 +70,7 @@ void state_t::command(v2f_t x)
if (unit->dead)
continue;
- unit->start_moving(snap, now);
+ unit->start_moving(snap);
}
}
@@ -109,19 +109,19 @@ void state_t::tick(double now_, double dt_)
enemy->awake = true;
awake_units.insert(enemy);
- enemy->wake(now, unit);
+ enemy->wake(unit);
}
- unit->think(now, dt);
+ unit->think();
}
for (auto i = std::begin(awake_units); i != std::end(awake_units);) {
if (now - (*i)->wake_time >= 5.0) {
(*i)->awake = false;
- (*i)->sleep(now);
+ (*i)->sleep();
i = awake_units.erase(i);
} else {
- (*i)->think(now, dt);
+ (*i)->think();
i++;
}
}