#include "GameState.h"

void GameState :: gamestateLevelCompleteAfterDraw ()
{
  inputBufferIterator = inputBuffer.begin ();
  while (inputBufferIterator < inputBuffer.end ())
    {
      if (inputBufferIterator -> getInput () == INPUT_QUITGAME)
        {
          addQuitCommand ();
        }
      inputBufferIterator ++;
    }

  if (SDL_GetTicks () >= 1000 + startTime)
    {
      //set between levels to true. Then go to inventory.
      rulez.setBetweenLevels (true);
      rulez.newLevel ();

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

      setNewGameState (GAMESTATE_INVENTORY);
    }
}
