Fix State_OverworldMap dependency in TMXParser.h
This commit is contained in:
@@ -1,19 +1,35 @@
|
||||
#include "GameState.h"
|
||||
#pragma once
|
||||
#include "State_OverworldMap.h"
|
||||
#include "Crawler.h"
|
||||
#include "DEFINES.h"
|
||||
#include "Menu.h"
|
||||
#include "Item.h"
|
||||
|
||||
INCLUDE_MONSTER_LIST
|
||||
INCLUDE_game
|
||||
|
||||
std::vector<ConnectionPoint>State_OverworldMap::connections;
|
||||
|
||||
State_OverworldMap::State_OverworldMap(){
|
||||
SetStageMarker("Stage I-I"); //Eventually we will load the game from a file and this will not be necessary. We just set it to this for now.
|
||||
game->GetPlayer()->SetPos(currentConnectionPoint->rect.pos);
|
||||
}
|
||||
void State_OverworldMap::OnStateChange(GameState*prevState){
|
||||
Menu::CloseAllMenus();
|
||||
};
|
||||
void State_OverworldMap::OnUserUpdate(Crawler*game){
|
||||
|
||||
game->camera.SetTarget(currentConnectionPoint->rect.middle());
|
||||
game->UpdateCamera(game->GetElapsedTime());
|
||||
};
|
||||
void State_OverworldMap::Draw(Crawler*game){
|
||||
|
||||
};
|
||||
};
|
||||
void State_OverworldMap::SetStageMarker(std::string connectionName){
|
||||
for(ConnectionPoint&connection:connections){
|
||||
if(connection.name==connectionName){
|
||||
currentConnectionPoint=&connection;
|
||||
return;
|
||||
}
|
||||
}
|
||||
std::cout<<"WARNING! Could not find a connection point with name "<<connectionName<<"!"<<std::endl;
|
||||
throw;
|
||||
}
|
||||
Reference in New Issue
Block a user