updated to gameclass merged with v1.1 power
This commit is contained in:
@@ -4,12 +4,12 @@
|
||||
|
||||
std::vector<c_button *> buttonlist;
|
||||
|
||||
c_button button1(SWITCH1, YELLOW, 1);
|
||||
c_button button2(SWITCH2, RED, 2);
|
||||
c_button button3(SWITCH3, GREEN, 3);
|
||||
c_button button4(SWITCH12, YELLOW2, 4);
|
||||
c_button button5(SWITCH22, RED2, 5);
|
||||
c_button button6(SWITCH32, GREEN2, 6);
|
||||
c_button button1(SWITCH1, YELLOW, 1, type_switch);
|
||||
c_button button2(SWITCH2, RED, 2, type_switch);
|
||||
c_button button3(SWITCH3, GREEN, 3, type_switch);
|
||||
c_button button4(SWITCH12, YELLOW2, 4, type_momentary);
|
||||
c_button button5(SWITCH22, RED2, 5, type_momentary);
|
||||
c_button button6(SWITCH32, GREEN2, 6, type_momentary);
|
||||
|
||||
void buttonbegin(c_button *thisbutton)
|
||||
{
|
||||
@@ -61,6 +61,32 @@ bool anyButtonChanged(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool allButtons(void)
|
||||
{
|
||||
for( auto&& thisbutton : buttonlist)
|
||||
{
|
||||
if(thisbutton->getType() == type_switch)
|
||||
{
|
||||
if(!thisbutton->isPressed())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool onlyButton(e_ledcolor color)
|
||||
{
|
||||
for (auto &&thisbutton : buttonlist)
|
||||
{
|
||||
if (thisbutton->isPressed() && thisbutton->getColor() != color)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return getButton(color)->isPressed();
|
||||
}
|
||||
|
||||
bool buttonIsPressed(e_ledcolor index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user