#include "GameState.h"

void GameState :: gamestateChooseYourIntroPowersStartup()
{
  rulez.newGame ();

  //load the map here
  rander.clearResourceMap ();
  rander.loadResourceMap (rulez.getMap (), rulez.getPlayerMapUnit(), rulez.getEnemyMapUnits());
  rander.clearResourceMapEnemy ();
  rander.loadResourceMapEnemy ();

  rulez.getPlayer().addNewItem ("Equipment", "Equipment");
  rulez.getPlayer().equipEquipment ("Equipment");
  rulez.getPlayer().addNewItem ("ConsumeThis", "Item");
  rulez.getPlayer().addMoney (100);
  rulez.newStore ();
  rulez.setBetweenLevels (true);
}

void GameState :: gamestateChooseYourIntroPowersAfterDraw(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_SWOOSH);
            }

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

      inputBufferIterator ++;
    }
}
