Ejemplo n.º 1
0
	void GameStateManager::ChangeState(GameState& gs)
	{
		while (!GameStates.empty())
			GameStates.pop();
		
		if (!gs.Loaded)
			gs.Initialize();
		GameStates.push(&gs);
	}
Ejemplo 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;
}
Ejemplo n.º 3
0
	void GameStateManager::PushState(GameState& gs)
	{
		if (!gs.Loaded)
			gs.Initialize();
		GameStates.push(&gs);
	}