X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fstage.cpp;h=0eb4238fcff375709404b00e52061730e0694cae;hb=38ffef0320a70909f3e13e9681e4720352e440aa;hp=8d781f28961fc77da688b640c9c579a44c9b4a28;hpb=86057ab12bea9aaf40be2f1f2a0a3e64e94f0313;p=libs%2Fgame.git diff --git a/source/game/stage.cpp b/source/game/stage.cpp index 8d781f2..0eb4238 100644 --- a/source/game/stage.cpp +++ b/source/game/stage.cpp @@ -4,7 +4,8 @@ namespace Msp::Game { -Stage::Stage(): +Stage::Stage(DataFile::Collection &r): + resources(r), event_source(event_bus), root(std::make_unique(*this)) { } @@ -13,6 +14,11 @@ Stage::Stage(): Stage::~Stage() { } +void Stage::remove_system(System &s) +{ + erase_if(systems, [&s](auto &p){ return p.get()==&s; }); +} + void Stage::tick(Time::TimeDelta dt) { for(const auto &s: systems)