]> git.tdb.fi Git - libs/game.git/blob - source/game/stage.cpp
73eb9a55f7299542cb08cf8c95b44083d7ee8fc2
[libs/game.git] / source / game / stage.cpp
1 #include "stage.h"
2 #include "root.h"
3 #include "system.h"
4
5 namespace Msp::Game {
6
7 Stage::Stage():
8         event_source(event_bus),
9         root(std::make_unique<Root>(*this))
10 { }
11
12 // Hide unique_ptr destructors from the header
13 Stage::~Stage()
14 { }
15
16 void Stage::tick(Time::TimeDelta dt)
17 {
18         for(const auto &s: systems)
19                 s->pre_tick();
20         for(const auto &s: systems)
21                 s->tick(dt);
22         for(const auto &s: systems)
23                 s->post_tick();
24 }
25
26 } // namespace Msp::Game