#include "GameState.h"

void GameState :: gamestateContinueGameAfterDraw(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_MAP);

          if (isMouseOnHotSpot((*inputBufferIterator), buttonVect[1], false))
            setNewGameState (GAMESTATE_LEVEL_COMPLETE);

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

      inputBufferIterator ++;
    }
}
