#include "simpleled.h"


void c_simpleLed::runGame(void)
{
  handleSimpleLed();
}

void c_simpleLed::initGame(void)
{
  initSimpleLed();
  _status = true;
}


extern std::vector<c_button *> buttonlist;

bool status = false;

void initSimpleLed(void)
{
  status = true;
}

void handleSimpleLed(void)
{
  for (auto &&button : buttonlist)
  {
    if (button->isPressed())
    {
      turnOnLed(button->getIndex());
    }
    else
    {
      turnOffLed(button->getIndex());
    }
  }
}

bool getStatusSimpleLed( void )
{
  return status;
}