#include "GameState.h"

void GameState :: gamestateGameMenuAfterDraw(uint8_t numButtonsToUse)
{
  inputBufferIterator = inputBuffer.begin ();
  while (inputBufferIterator < inputBuffer.end ())
    {
      if (inputBufferIterator -> getInput () == INPUT_MOUSEUP)
        {
          clearButtons (numButtonsToUse);

          if (isMouseOnHotSpot((*inputBufferIterator), buttonVect[0], false))
            setNewGameState (GAMESTATE_MAIN_MENU);

          if (isMouseOnHotSpot((*inputBufferIterator), buttonVect[1], false))
            setNewGameState (previousGamestate);
        }
      if (inputBufferIterator -> getInput () == INPUT_MOUSEDOWN)
        {
          buttonUpdateClickStatus ((*inputBufferIterator), numButtonsToUse);
        }
      if (inputBufferIterator -> getInput () == INPUT_QUITGAME)
        {
          addQuitCommand ();
        }

      inputBufferIterator ++;
    }
}
