本文整理汇总了C++中Mission::getTitle方法的典型用法代码示例。如果您正苦于以下问题:C++ Mission::getTitle方法的具体用法?C++ Mission::getTitle怎么用?C++ Mission::getTitle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mission
的用法示例。
在下文中一共展示了Mission::getTitle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: selectedMission
Menu::Menu() : selectedMission(NULL), remake(false)
{
int height, NUM_MISSIONS, NUM_COMPLETED_MISSIONS; // replace with something more dynamic
switch (screenState)
{
case START_SCREEN:
numButtons = 5;
buttons = new Button[numButtons];
buttons[0] = Button("New Game", 5 , 500,450 , 0.6,0.8,0.2 , 1, initNewGame);
buttons[1] = Button("Load Game",5 , 500,400 , 0.6,0.8,0.2 , 2, NULL);
buttons[2] = Button("Options", 5 , 500,350 , 0.6,0.8,0.2 , 3, initOptionsScreen);
buttons[3] = Button("Quit", 5 , 500,300 , 0.6,0.8,0.2 , 4, cleanup);
//buttons[4] = Button("TEST", 5 , 500,250 , 0.6,0.8,0.2 , 5, initPlanet);
//buttons[5] = Button("Game Over", 5 , 500,200 , 0.6,0.8,0.2 , 6, initGameOver);
break;
case OPTIONS_SCREEN:
numButtons = 5;
buttons = new Button[numButtons];
buttons[0] = Button("Keyboard Layout", 5 , 500,450 , 0.6,0.8,0.2 , 1, NULL);
buttons[1] = Button("Mouse Options", 5 , 500,400 , 0.6,0.8,0.2 , 2, NULL);
buttons[2] = Button("Video Options", 5 , 500,350 , 0.6,0.8,0.2 , 3, NULL);
buttons[3] = Button("Sound Options", 5 , 500,300 , 0.6,0.8,0.2 , 4, NULL);
buttons[4] = Button("Done", 5 , 500,250 , 0.6,0.8,0.2 , 5, initStartScreen);
break;
case TACTICAL:
// Sound sound("music");
// sound.play();
//numButtons = 2;
//buttons = new Button[numButtons];
//buttons[0] = Button("-", .1, miniMapX - 85, miniMapY, 0, 0, .2, 1, NULL);
//buttons[1] = Button("+", .1, miniMapX + 85, miniMapY, 0, 0, .2, 2, NULL);
break;
case PLANET:
numButtons = 6;
buttons = new Button[numButtons];
buttons[0] = Button("Mission Board", 5 , 450,450 , .3,.3,1 , 1, initMissionBoard);
buttons[1] = Button("Refuel",5 , 450, 400 , .3,.3,1 , 2, refuelPlayer);
buttons[2] = Button("More Ammo",5 , 450, 350 , .3,.3,1 , 3, reloadPlayerAmmo);
buttons[3] = Button("Heal",5 , 450, 300 , .3,.3,1 , 4, healPlayer);
buttons[4] = Button("Sell materials",5 , 450, 250 , .3,.3,1 , 5, sellMaterials);
buttons[5] = Button("Leave",5 , 450, 200 , .3,.3,1 , 6, initTactical);
break;
case MISSION_BOARD: // (Gum) (Note: this would be a lot easier if I could pass parameters into the functions I'm passing)
NUM_MISSIONS = missionsAvailable.size();
NUM_COMPLETED_MISSIONS = missionsComplete.size();
height = 720;
numButtons = 3 + NUM_MISSIONS + NUM_COMPLETED_MISSIONS;
buttons = new Button[numButtons];
//draw the two main buttons
buttons [0] = Button("Accept Mission", 5, 150, 300, .7,.1,.1, -1, NULL); // Accept Mission will have id -1 (See processHits)
buttons [1] = Button("Claim Reward", 5, 150, 250, .1,.7,.1, -2, NULL); // Claim reward will have id 1 (See processHits)
buttons [2] = Button("Exit", 5, 500, 30, .4,.5,.7, 2, initPlanet);
//draw available mission titles
for (int i = 0; i < NUM_MISSIONS; i ++)
{
Mission *m = missionsAvailable[i];
buttons[i + NUM_COMPLETED_MISSIONS + 3] =
Button(m->getTitle(), 1, 20, height, .7,.1,.1, (100 + i), NULL);
height -= 30;
}
// Draw completed mission titles
for (int i = 0; i < NUM_COMPLETED_MISSIONS; i++)
{
Mission *m = missionsComplete.at(i);
buttons[i + 3] = Button(m->getTitle(), 1, 20, height, .1,.7,.1, (200 + i), NULL);
height -= 30;
}
// handle displaying briefing, objectives, and reward when mission title is clicked
break;
case GAME_OVER:
numButtons = 4;
buttons = new Button[numButtons];
buttons[0] = Button("New Game", 5 , 500,450 , 0.8,0.2,0.1 , 1, initNewGame);
buttons[1] = Button("Load Game",5 , 500,400 , 0.8,0.2,0.1 , 2, NULL);
buttons[2] = Button("Options", 5 , 500,350 , 0.8,0.2,0.1 , 3, NULL);
buttons[3] = Button("Quit", 5 , 500,300 , 0.8,0.2,0.1 , 4, cleanup);
break;
}
}