]> git.tdb.fi Git - libs/game.git/blob - source/game/stage.cpp
a616d5a94da775ebd61da5171e9b4baf2435215d
[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         root(std::make_unique<Root>(*this))
9 { }
10
11 // Hide unique_ptr destructors from the header
12 Stage::~Stage()
13 { }
14
15 void Stage::tick(Time::TimeDelta dt)
16 {
17         for(const auto &s: systems)
18                 s->pre_tick();
19         for(const auto &s: systems)
20                 s->tick(dt);
21         for(const auto &s: systems)
22                 s->post_tick();
23 }
24
25 } // namespace Msp::Game