本文整理汇总了C++中boost::thread_specific_ptr::getObjInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ thread_specific_ptr::getObjInstance方法的具体用法?C++ thread_specific_ptr::getObjInstance怎么用?C++ thread_specific_ptr::getObjInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类boost::thread_specific_ptr
的用法示例。
在下文中一共展示了thread_specific_ptr::getObjInstance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: COMMAND
std::string Goals::AbstractGoal::name() const //TODO: virtualize
{
std::string desc;
switch (goalType)
{
case INVALID:
return "INVALID";
case WIN:
return "WIN";
case DO_NOT_LOSE:
return "DO NOT LOOSE";
case CONQUER:
return "CONQUER";
case BUILD:
return "BUILD";
case EXPLORE:
desc = "EXPLORE";
break;
case GATHER_ARMY:
desc = "GATHER ARMY";
break;
case BOOST_HERO:
desc = "BOOST_HERO (unsupported)";
break;
case RECRUIT_HERO:
return "RECRUIT HERO";
case BUILD_STRUCTURE:
return "BUILD STRUCTURE";
case COLLECT_RES:
desc = "COLLECT RESOURCE";
break;
case GATHER_TROOPS:
desc = "GATHER TROOPS";
break;
case GET_OBJ:
{
auto obj = cb->getObjInstance(ObjectInstanceID(objid));
if (obj)
desc = "GET OBJ " + obj->getHoverText();
}
case FIND_OBJ:
desc = "FIND OBJ " + boost::lexical_cast<std::string>(objid);
break;
case VISIT_HERO:
{
auto obj = cb->getObjInstance(ObjectInstanceID(objid));
if (obj)
desc = "VISIT HERO " + obj->getHoverText();
}
break;
case GET_ART_TYPE:
desc = "GET ARTIFACT OF TYPE " + VLC->arth->artifacts[aid]->Name();
break;
case ISSUE_COMMAND:
return "ISSUE COMMAND (unsupported)";
case VISIT_TILE:
desc = "VISIT TILE " + tile();
break;
case CLEAR_WAY_TO:
desc = "CLEAR WAY TO " + tile();
break;
case DIG_AT_TILE:
desc = "DIG AT TILE " + tile();
break;
default:
return boost::lexical_cast<std::string>(goalType);
}
if (hero.get(true)) //FIXME: used to crash when we lost hero and failed goal
desc += " (" + hero->name + ")";
return desc;
}