本文整理汇总了C++中Director::getGame方法的典型用法代码示例。如果您正苦于以下问题:C++ Director::getGame方法的具体用法?C++ Director::getGame怎么用?C++ Director::getGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Director
的用法示例。
在下文中一共展示了Director::getGame方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: loadPlayersMap
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;
}
}
示例2: main
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")