本文整理汇总了C++中Container::GetDescription方法的典型用法代码示例。如果您正苦于以下问题:C++ Container::GetDescription方法的具体用法?C++ Container::GetDescription怎么用?C++ Container::GetDescription使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Container
的用法示例。
在下文中一共展示了Container::GetDescription方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowCommands
void ShowCommands()
{
//acciones de palabras simples
std::string action = stackCommands.Consult().c_str();
int i = 0;
char result = 's';
switch (Hashit(Upcase(action)))
{
case ayuda:
printf(HELP_LIST);
colortext(WHITE); printf(LEAVE); colortext(LIGHTGREY); printf(HELP_LEAVE);
colortext(WHITE); printf(OPEN_DOOR); colortext(LIGHTGREY); printf(HELP_OPEN_DOOR);
colortext(WHITE); printf(CLEAR_SCREEN); colortext(LIGHTGREY); printf(HELP_CLEAR_SCREEN);
colortext(WHITE); printf(PICKUP); colortext(LIGHTGREY); printf(HELP_PICKUP);
colortext(WHITE); printf(EAST); colortext(LIGHTGREY); printf(HELP_EAST);
colortext(WHITE); printf(PUT_IN_BAG); colortext(LIGHTGREY); printf(HELP_PUT_IN_BAG);
colortext(WHITE); printf(INV); colortext(LIGHTGREY); printf(HELP_INV);
colortext(WHITE); printf(LOOK); colortext(LIGHTGREY); printf(HELP_LOOK);
colortext(WHITE); printf(NORTH); colortext(LIGHTGREY); printf(HELP_NORTH);
colortext(WHITE); printf(WEST); colortext(LIGHTGREY); printf(HELP_WEST);
colortext(WHITE); printf(EXITS); colortext(LIGHTGREY); printf(HELP_EXITS);
colortext(WHITE); printf(DROP); colortext(LIGHTGREY); printf(HELP_DROP);
colortext(WHITE); printf(GET_FROM_BAG); colortext(LIGHTGREY); printf(GET_FROM_BAG);
colortext(WHITE); printf(SOUTH); colortext(LIGHTGREY); printf(HELP_SOUTH);
break;
case mirar:
NewRoom();
break;
case norte:
if (myMap.CheckN(myPlayer.GetLatitude(), myPlayer.GetLongitude()) > 0 && myMap.CheckN(myPlayer.GetLatitude(), myPlayer.GetLongitude()) < 100)
{
myPlayer.SetLatitude(myPlayer.GetLatitude() - 1);
NewRoom();
}
else printf(NO_EXITS);
break;
case sur:
if (myMap.CheckS(myPlayer.GetLatitude(), myPlayer.GetLongitude())> 0 && myMap.CheckS(myPlayer.GetLatitude(), myPlayer.GetLongitude()) < 100)
{
myPlayer.SetLatitude(myPlayer.GetLatitude() + 1);
NewRoom();
}
else printf(NO_EXITS);
break;
case este:
if (myMap.CheckE(myPlayer.GetLatitude(), myPlayer.GetLongitude())> 0 && myMap.CheckE(myPlayer.GetLatitude(), myPlayer.GetLongitude()) < 100)
{
myPlayer.SetLongitude(myPlayer.GetLongitude() + 1);
NewRoom();
}
else printf(NO_EXITS);
break;
case oeste:
if (myMap.CheckW(myPlayer.GetLatitude(), myPlayer.GetLongitude())> 0 && myMap.CheckW(myPlayer.GetLatitude(), myPlayer.GetLongitude()) < 100)
{
myPlayer.SetLongitude(myPlayer.GetLongitude() - 1);
NewRoom();
}
else printf(NO_EXITS);
break;
case salidas:
myMap.ShowExits(myPlayer.GetLatitude(), myPlayer.GetLongitude());
break;
case cls:
system("cls");
break;
case inventario:
printf(INVENTORY);
if (bag.GetState() == 's')
printf(Show_Item(bag.GetDescription().c_str()));
if (myPlayer.inventory.Size() > 0)
{
for (int i = 0; i < myPlayer.inventory.Size(); ++i)
printf(Show_Item(myPlayer.inventory.GetDescPosN(i).c_str()));
}
else
if ( bag.GetState() != 's' ) printf( NOTHING_TO_SHOW );
break;
default:
result = 'n';
break;
}
//acciones de 2 palabras
action = GetWord(stackCommands.Consult().c_str());
Item::Node *tmp;
switch (Hashit(Upcase(action)))
{
case coger:
action = CutFirstWord(stackCommands.Consult().c_str());
action = GetWord(action.c_str());
if (action == BAG)
{
bag.ToInventory(myPlayer.GetLatitude(), myPlayer.GetLongitude());
}
else
//.........这里部分代码省略.........