Ejemplo n.º 1
0
bool Driver::loadPlayersMap(string location){
	Director director;
	MapBuilder* mapWithPlayersBuilder = new MapWithPlayers;
	director.setMapBuilder(mapWithPlayersBuilder);
	if (director.constructMap(location)){
		mainMap = director.getMap();
		mainGame = director.getGame();
		playersSet = true;
		return true;
	}
	else{
		return false;
	}
}
Ejemplo n.º 2
0
int main() {

	//STARTUP PHASE **********************************

	//The number of players will be used throughout the game. It cannot be more than 4
	//at the moment in order to limit the number of countries that need to be used to 
	//run the driver.

	//initialize the map
	MapEditor editor;
	Map map;
	bool validate = false;
	bool isLoad = false;
	GamePlay gameTurn;
	Director director;
	GameBuilder* gameRisk = new RiskGameBuilder();
	director.setGameBuilder(gameRisk);
	director.constructGame(&map, &gameTurn);
	Game* risk = director.getGame();
	while(validate == false)
	{
		Map tempMap;
		cout<<"How to implement the map:" << endl;
		cout<<"1. Create your own map." << endl;
		cout<<"2. Load an existing map." << endl;
		cout<<"3. Load game." << endl;
		string temp;
		cin >> temp;
		string temp2 = "";
		//if the user choose to load a map
		if(temp == "2")
		{
			cout<<"Please enter map name: " << endl;

			cin >> temp2;
		}
		else if (temp == "3")