#include "GameState.h"

void GameState :: gamestateBattleEnemyPhaseAfterDraw (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_BATTLE_CHECK_FOR_RESULT);
              rulez.declarePlayerLost ();
            }

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

          if (isMouseOnHotSpot((*inputBufferIterator), buttonVect[2], false))
            {
              setNewGameState (GAMESTATE_GAME_MENU);
            }
        }

      if (inputBufferIterator -> getInput () == INPUT_MOUSEDOWN)
        {
          buttonUpdateClickStatus ((*inputBufferIterator), numButtonsToUse);
        }
      if (inputBufferIterator -> getInput () == INPUT_QUITGAME)
        {
          addQuitCommand ();
        }

      inputBufferIterator ++;
    }
}
