firmware recovery 1.3RC
This commit is contained in:
37
src/game.h
37
src/game.h
@@ -1,60 +1,59 @@
|
||||
#ifndef GAMEH
|
||||
#define GAMEH
|
||||
|
||||
#include "led.h"
|
||||
|
||||
#define GAMESELECTTIMEOUT 10000 // 10sec * 1000ms
|
||||
|
||||
|
||||
typedef enum
|
||||
enum e_game
|
||||
{
|
||||
none,
|
||||
simpleled,
|
||||
chaingame,
|
||||
magicswitchboard
|
||||
} e_game;
|
||||
magicswitchboard,
|
||||
detectled
|
||||
};
|
||||
|
||||
typedef enum
|
||||
enum e_gamestate
|
||||
{
|
||||
disabled,
|
||||
init,
|
||||
active
|
||||
} e_gamestate;
|
||||
active,
|
||||
init_error
|
||||
};
|
||||
|
||||
|
||||
typedef enum
|
||||
enum e_state
|
||||
{
|
||||
state_init,
|
||||
state_idle,
|
||||
state_play
|
||||
}e_state;
|
||||
};
|
||||
|
||||
class c_game
|
||||
{
|
||||
protected:
|
||||
const e_game _gameindex;
|
||||
e_gamestate _status;
|
||||
const e_ledcolor _gamecolor;
|
||||
|
||||
public:
|
||||
c_game(e_game index) : _gameindex(index) { _status = disabled; }
|
||||
c_game(e_game index, e_ledcolor gamecolor) : _gameindex(index), _gamecolor(gamecolor) { _status = disabled; }
|
||||
|
||||
virtual void runGame(void);
|
||||
virtual void initGame(void);
|
||||
virtual bool initGame(void);
|
||||
virtual void resetGame(void);
|
||||
e_gamestate getStatus(void) { return _status; }
|
||||
e_game getIndex(void) { return _gameindex; }
|
||||
void setStatus(e_gamestate newstate) { _status = newstate; }
|
||||
void setStatus(e_gamestate newstate);
|
||||
e_ledcolor getGameColor(void) { return _gamecolor; }
|
||||
};
|
||||
|
||||
c_game *getGame(e_game game);
|
||||
c_game *getGame(e_game game, e_ledcolor gamecolor);
|
||||
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