moved all code to gameclass
This commit is contained in:
@@ -7,16 +7,24 @@
|
||||
#include "board.h"
|
||||
#include "led.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
type_switch,
|
||||
type_momentary
|
||||
}e_switchtype;
|
||||
|
||||
class c_button : public ToggleButton
|
||||
{
|
||||
const e_ledcolor _color;
|
||||
const uint8_t _index;
|
||||
const e_switchtype _switchtype;
|
||||
|
||||
public:
|
||||
c_button(uint8_t pin, e_ledcolor color, uint8_t index)
|
||||
: ToggleButton(pin), _color(color), _index(index) {}
|
||||
c_button(uint8_t pin, e_ledcolor color, uint8_t index, e_switchtype switchtype)
|
||||
: ToggleButton(pin), _color(color), _index(index), _switchtype(switchtype) {}
|
||||
|
||||
e_ledcolor getColor( void ){return _color;}
|
||||
e_switchtype getType(void) { return _switchtype;}
|
||||
uint8_t getIndex( void ) {return _index;}
|
||||
bool isChanged( void ) {return changed();}
|
||||
|
||||
@@ -26,6 +34,8 @@ bool anybutton(void);
|
||||
bool anyButtonChanged(void);
|
||||
void initButtons(void);
|
||||
void handleButtons(void);
|
||||
bool allButtons(void);
|
||||
bool onlyButton(e_ledcolor color);
|
||||
c_button *getButton(unsigned int index);
|
||||
c_button *getButton(e_ledcolor index);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user