#include "GameState.h"
#include "Crawler.h"
#include "DEFINES.h"
#include "Menu.h"

INCLUDE_MONSTER_LIST

void State_GameRun::OnStateChange(GameState*prevState){
	Menu::stack.clear();
};
void State_GameRun::OnUserUpdate(Crawler*game){
	game->bossDisplayTimer=std::max(0.f,game->bossDisplayTimer-game->GetElapsedTime());
	if(game->encounterStarted&&game->totalBossEncounterMobs>0){
		game->encounterDuration+=game->GetElapsedTime();
	}
	game->HandleUserInput(game->GetElapsedTime());

	if(game->GetKey(T).bPressed){
		GameState::ChangeState(States::MAIN_MENU);
	}

	game->UpdateEffects(game->GetElapsedTime());
	game->GetPlayer()->Update(game->GetElapsedTime());
	for(Monster&m:MONSTER_LIST){
		m.Update(game->GetElapsedTime());
	}
	for(Monster&m:game->monstersToBeSpawned){
		MONSTER_LIST.push_back(m);
	}
	game->monstersToBeSpawned.clear();

	game->UpdateBullets(game->GetElapsedTime());
	game->UpdateCamera(game->GetElapsedTime());
};
void State_GameRun::Draw(Crawler*game){

};