#include "game.h"
#include <vector>

#include "simpleled.h"


std::vector<c_game *> gameslist;

void initGames(void)
{
  gameslist.clear();
  gameslist.push_back(new c_simpleLed(simpleled));
}

void runGame(void)
{
  for(auto &&game: gameslist)
  {
    if(game->getStatus() == active)
    {
      game->runGame();
      return;
    }
    if(game->getStatus() == init)
    {
      game->initGame();
      return;
    }
  }
}

void activateGame(e_game nextgame)
{
  for(auto &&game: gameslist)
  {
    if(game->getIndex() == nextgame)
    {
      if(game->getStatus() != active)
      {
        game->setStatus(init);
      }
    }
    else
    {
      game->setStatus(disabled);
    }
  }
}






