Skip to content

Commit

Permalink
Merge 1dfb607 into 6ab9b86
Browse files Browse the repository at this point in the history
  • Loading branch information
hhirsch committed Jan 16, 2018
2 parents 6ab9b86 + 1dfb607 commit ae22ef5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/radix/GameWorld.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define RADIX_GAME_WORLD_HPP

#include <list>
#include <algorithm>

namespace radix {

Expand All @@ -13,6 +14,7 @@ class GameWorld {
InputSource &input;
GameWorld(InputSource &input);
void addScreen(Screen& screen);
void removeScreen(Screen& screen);
std::list<Screen*>* getScreens();
private:
std::list<Screen*> screens;
Expand Down
4 changes: 4 additions & 0 deletions source/GameWorld.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ void GameWorld::addScreen(Screen &screen) {
screens.push_back(&screen);
}

void GameWorld::removeScreen(Screen &screen) {
screens.erase(std::remove(screens.begin(), screens.end(), &screen), screens.end());
}

std::list<Screen*>* GameWorld::getScreens() {
return &screens;
}
Expand Down

0 comments on commit ae22ef5

Please sign in to comment.