Skip to content

Commit

Permalink
Rename GameState to GameStateManager
Browse files Browse the repository at this point in the history
  • Loading branch information
hhirsch committed Feb 25, 2018
1 parent dfc1f7c commit dd48f95
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#ifndef RADIX_GAMESTATE_HPP
#define RADIX_GAMESTATE_HPP
#ifndef RADIX_GAMESTATE_MANAGER_HPP
#define RADIX_GAMESTATE_MANAGER_HPP

#include <radix/BaseGame.hpp>
#include <radix/core/event/Event.hpp>

namespace radix {

class GameState {
class GameStateManager {
public:
struct WinEvent : public Event {
radix_event_declare("radix/GameState:Win")
Expand All @@ -20,4 +20,4 @@ class GameState {

} /* namespace radix */

#endif /* RADIX_GAMESTATE_HPP */
#endif /* RADIX_GAMESTATE_MANAGER_HPP */
2 changes: 1 addition & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ set(RADIX_SOURCES
${D}/core/math/Vector2ui.cpp
${D}/core/math/Vector3f.cpp
${D}/core/math/Vector4f.cpp
${D}/core/state/GameState.cpp
${D}/core/state/GameStateManager.cpp
${D}/Entity.cpp
${D}/EntityManager.cpp
${D}/entities/Player.cpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>

#include <radix/core/state/HandleGameFunction.hpp>
#include <radix/World.hpp>

namespace radix {

void GameState::handleInput(BaseGame &game) {
void GameStateManager::handleInput(BaseGame &game) {
HandleGameFunction stateFunction = game.getWorld()->stateFunctionStack.top();
stateFunction(game);
}
Expand Down
2 changes: 1 addition & 1 deletion source/data/map/AudioTrigger.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <radix/data/map/AudioTrigger.hpp>
#include <radix/core/math/Math.hpp>
#include <radix/entities/Trigger.hpp>
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>
#include <radix/env/Environment.hpp>
#include <radix/SoundManager.hpp>

Expand Down
2 changes: 1 addition & 1 deletion source/data/map/MapTrigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include <radix/data/map/XmlMapLoader.hpp>
#include <radix/core/math/Math.hpp>
#include <radix/entities/Trigger.hpp>
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>
#include <radix/env/Environment.hpp>
#include <radix/World.hpp>

Expand Down
2 changes: 1 addition & 1 deletion source/data/map/RadiationTrigger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <radix/entities/Player.hpp>
#include <radix/entities/Trigger.hpp>
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>
#include <radix/World.hpp>

using namespace std;
Expand Down
4 changes: 2 additions & 2 deletions source/data/map/WinTrigger.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <radix/data/map/WinTrigger.hpp>

#include <radix/entities/Trigger.hpp>
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>
#include <radix/World.hpp>

using namespace std;
Expand All @@ -13,7 +13,7 @@ const std::string WinTrigger::TYPE = "win";
void WinTrigger::addAction(Entity &ent) {
entities::Trigger &trigger = dynamic_cast<entities::Trigger&>(ent);
trigger.setActionOnUpdate([] (entities::Trigger &trigger) {
trigger.world.event.dispatch(GameState::WinEvent());
trigger.world.event.dispatch(GameStateManager::WinEvent());
});
}

Expand Down
2 changes: 1 addition & 1 deletion source/data/map/XmlHelper.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <radix/data/map/XmlHelper.hpp>
#include <radix/data/map/XmlMapLoader.hpp>
#include <radix/core/math/Math.hpp>
#include <radix/core/state/GameState.hpp>
#include <radix/core/state/GameStateManager.hpp>
#include <radix/SoundManager.hpp>
#include <radix/env/Environment.hpp>

Expand Down

0 comments on commit dd48f95

Please sign in to comment.