Esempio n. 1
0
	void GameStateManager::ChangeState(GameState& gs)
	{
		while (!GameStates.empty())
			GameStates.pop();
		
		if (!gs.Loaded)
			gs.Initialize();
		GameStates.push(&gs);
	}
Esempio n. 2
0
int main()
{
	// Load in game data
	std::unique_ptr<IDungeonBuilder> dungeonBuilder = 
		std::unique_ptr<IDungeonBuilder>(new StandardDungeonBuilder());

	std::shared_ptr<IDungeon> dungeon = CreateDungeonFromXml(L"Content\\adventure.xml", *dungeonBuilder);

	// Start up main game loop
	GameState gameState = GameState();
	gameState.Initialize();
	gameState.BeginDungeon(dungeon);

	bool stillPlaying = true;
	while (stillPlaying)
	{
		stillPlaying = gameState.RunGameLoopStep();
	}

	return 0;
}
Esempio n. 3
0
	void GameStateManager::PushState(GameState& gs)
	{
		if (!gs.Loaded)
			gs.Initialize();
		GameStates.push(&gs);
	}