本文整理汇总了C++中Floor::pcBuy方法的典型用法代码示例。如果您正苦于以下问题:C++ Floor::pcBuy方法的具体用法?C++ Floor::pcBuy怎么用?C++ Floor::pcBuy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Floor
的用法示例。
在下文中一共展示了Floor::pcBuy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
//.........这里部分代码省略.........
break;
case 'e':
cin >> dir;
if (dir == 'a') {
f->pcAttack(4);
} else {
cout << "invalid command" << endl;
}
break;
case 's':
cin >> dir;
switch(dir) {
case 'w':
f->pcAttack(5);
break;
case 'o':
f->pcAttack(6);
break;
case 'e':
f->pcAttack(7);
break;
default:
cout << "invalid command" << endl;
break;
}
break;
}
break;
case 'b':
int i;
cin >> i;
cin >> command;
f->pcBuy(command, i);
break;
case 'd': // drink potion
f->pcDrink();
break;
case 'r': // restart game
end = false;
delete f;
f = new Floor(25, 79);
f->init(argv[1]);
cout << "please choose your race" << endl;
cout << "h: human" << endl;
cout << "d: dwarf" << endl;
cout << "e: evlves" << endl;
cout << "o: orc" << endl;
cout << "i: ironman" << endl;
while (true) {
cin >> race; // specify race
if (race == 'q') return 0;
else if (race == 'h' || race == 'e' || race == 'd' || race == 'o'
|| race == 'i') break;
else cout << "no such race" << endl;
}
switch(race) {
case 'h':
character = new Human;
f->newGame(character);
break;
case 'e':
character = new Elves;
f->newGame(character);