Map names now stored based on stage plate names provided. Made unlock conditions based on their actual unlock conditions and not the names of the plates.
This commit is contained in:
@@ -29,11 +29,14 @@ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
*/
|
||||
#include "Crawler.h"
|
||||
#include "GameState.h"
|
||||
#include "State_GameRun.h"
|
||||
#include "State_OverworldMap.h"
|
||||
#include "State_MainMenu.h"
|
||||
|
||||
INCLUDE_game
|
||||
|
||||
#define NEW_STATE(state,class) GameState::states[state]=NEW class();
|
||||
|
||||
void GameState::Initialize(){
|
||||
@@ -44,4 +47,14 @@ void GameState::Initialize(){
|
||||
GameState::ChangeState(States::OVERWORLD_MAP);
|
||||
}
|
||||
|
||||
void GameState::ChangeState(States::State newState){
|
||||
GameState*prevState=STATE;
|
||||
if(!states.count(newState)){
|
||||
ERR("WARNING! State not defined for state "<<newState<<"!")
|
||||
}
|
||||
STATE=states.at(newState);
|
||||
game->camera.SetTarget(game->GetPlayer()->GetPos());
|
||||
STATE->OnStateChange(prevState);
|
||||
}
|
||||
|
||||
GameState::~GameState(){}
|
||||
Reference in New Issue
Block a user