updated to gameclass merged with v1.1 power
This commit is contained in:
41
src/game.h
41
src/game.h
@@ -1,12 +1,15 @@
|
||||
#ifndef GAMEH
|
||||
#define GAMEH
|
||||
|
||||
#define GAMESELECTTIMEOUT 10000 // 10sec * 1000ms
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
none,
|
||||
simpleled,
|
||||
chaingame,
|
||||
magicswitchboard,
|
||||
detectled
|
||||
magicswitchboard
|
||||
} e_game;
|
||||
|
||||
typedef enum
|
||||
@@ -14,22 +17,44 @@ typedef enum
|
||||
disabled,
|
||||
init,
|
||||
active
|
||||
} e_state;
|
||||
} e_gamestate;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
state_init,
|
||||
state_idle,
|
||||
state_play
|
||||
}e_state;
|
||||
|
||||
class c_game
|
||||
{
|
||||
private:
|
||||
protected:
|
||||
const e_game _gameindex;
|
||||
e_state _status;
|
||||
e_gamestate _status;
|
||||
|
||||
public:
|
||||
c_game(e_game index) : _gameindex(index) {_status = disabled;}
|
||||
c_game(e_game index) : _gameindex(index) { _status = disabled; }
|
||||
|
||||
virtual void runGame(void);
|
||||
virtual void initGame(void);
|
||||
e_state getStatus(void) { return _status; }
|
||||
virtual void resetGame(void);
|
||||
e_gamestate getStatus(void) { return _status; }
|
||||
e_game getIndex(void) { return _gameindex; }
|
||||
void setStatus(e_state newstate) { _status = newstate;}
|
||||
void setStatus(e_gamestate newstate) { _status = newstate; }
|
||||
};
|
||||
|
||||
c_game *getGame(e_game game);
|
||||
void runGame(e_game game);
|
||||
void runGames(void);
|
||||
void activateGame(e_game nextgame);
|
||||
|
||||
void initGames(void);
|
||||
//void HandleGameSelectTimeout(void);
|
||||
//void HandleGameIdle( void );
|
||||
//void setGameState(e_state newstate);
|
||||
//e_state getCurrentState( void );
|
||||
void handleGames();
|
||||
|
||||
|
||||
#endif //GAMEH
|
||||
Reference in New Issue
Block a user