Skip to content

Commit

Permalink
Simplify naming (Neon Engine)
Browse files Browse the repository at this point in the history
  • Loading branch information
theopnv committed Aug 2, 2018
1 parent 18ccf35 commit f373ed1
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions neon_engine/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace neon_engine
{

class IGameState;
class IState;

/**
* \brief Main class of the game engine
Expand Down Expand Up @@ -76,13 +76,13 @@ namespace neon_engine
* \brief Change the state
* \param state new state
*/
void changeState(const Sptr<IGameState>& state);
void changeState(const Sptr<IState>& state);

/**
* \brief Will pause the current state and change to a new one
* \param state new state
*/
void pushState(const Sptr<IGameState>& state);
void pushState(const Sptr<IState>& state);

/**
* \brief Will cleanup the current state, and resume the older one if present
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace neon_engine
Vector2<int> _winSize;
Vector2<int> _logicalWinSize;

std::stack<Sptr<IGameState>> _states;
std::stack<Sptr<IState>> _states;
NEventFuncMapper _eventFuncMapper;
NEventMapper _eventMapper;

Expand Down
4 changes: 2 additions & 2 deletions neon_engine/Core/StateManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ namespace neon_engine
}
}

void Core::changeState(const Sptr<IGameState>& state)
void Core::changeState(const Sptr<IState>& state)
{
_popState = true;

_states.push(state);
}

void Core::pushState(const Sptr<IGameState>& state)
void Core::pushState(const Sptr<IState>& state)
{
_popState = true;

Expand Down
10 changes: 5 additions & 5 deletions neon_engine/State/AState.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@
namespace neon_engine
{

class AGameState : public IGameState
class AState : public IState
{

public:
virtual ~AGameState() = default;
virtual ~AState() = default;

protected:
Sptr<Core> _ge;
Sptr<Core> _ge;

std::vector<Sptr<IGObject>> _gameObjects;
NEventFuncMapper _eventFuncMapper;
std::vector<Sptr<IUIObject>> _gameObjects;
NEventFuncMapper _eventFuncMapper;

virtual void setEventFuncMapper() = 0;
};
Expand Down
6 changes: 3 additions & 3 deletions neon_engine/State/IState.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace neon_engine
* It handles its rendering, and its events.
* It is very useful to implement different logic for menus, games...
*/
class IGameState
class IState
{

public:
Expand Down Expand Up @@ -53,10 +53,10 @@ namespace neon_engine
* \brief Give the order to the game engine to change state
* \param state the new state
*/
virtual void changeState(Sptr<IGameState> state) = 0;
virtual void changeState(Sptr<IState> state) = 0;

protected:
virtual ~IGameState() = default;
virtual ~IState() = default;
};

}
2 changes: 1 addition & 1 deletion neon_engine/UI/AUIObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace neon_engine
/**
* \brief Abstract class for GameObject
*/
class AGObject : public IGObject
class AGObject : public IUIObject
{

public:
Expand Down
4 changes: 2 additions & 2 deletions neon_engine/UI/IUIObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ namespace neon_engine
/**
* \brief Base class for every object managed by the graphical library (SDL2)
*/
class IGObject
class IUIObject
{

public:
virtual ~IGObject() = default;
virtual ~IUIObject() = default;

/**
* \brief Update state of the game object relatively to events
Expand Down

0 comments on commit f373ed1

Please sign in to comment.