本文整理汇总了C++中CAI_Stalker::brain方法的典型用法代码示例。如果您正苦于以下问题:C++ CAI_Stalker::brain方法的具体用法?C++ CAI_Stalker::brain怎么用?C++ CAI_Stalker::brain使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAI_Stalker
的用法示例。
在下文中一共展示了CAI_Stalker::brain方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
IC T *CScriptGameObject::action_planner()
{
CAI_Stalker *manager = smart_cast<CAI_Stalker*>(&object());
if (!manager)
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member action_planner!");
return (&manager->brain());
}
示例2:
void CScriptGameObject::set_mental_state (EMentalState mental_state)
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker)
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member movement!");
else {
#ifdef DEBUG
if (mental_state != eMentalStateDanger) {
if (stalker->brain().current_action_id() == StalkerDecisionSpace::eWorldOperatorCombatPlanner) {
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : set_mental_state is used during universal combat!");
return;
}
}
#endif // DEBUG
stalker->movement().set_mental_state (mental_state);
}
}
示例3: set_dest_level_vertex_id
void CScriptGameObject::set_dest_level_vertex_id(u32 level_vertex_id)
{
CAI_Stalker *stalker = smart_cast<CAI_Stalker*>(&object());
if (!stalker)
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : cannot access class member set_dest_level_vertex_id!");
else {
if (!ai().level_graph().valid_vertex_id(level_vertex_id)) {
#ifdef DEBUG
ai().script_engine().script_log (ScriptStorage::eLuaMessageTypeError,"CAI_Stalker : invalid vertex id being setup by action %s!",stalker->brain().CStalkerPlanner::current_action().m_action_name);
#endif
return;
}
THROW2 (stalker->movement().restrictions().accessible(level_vertex_id),*stalker->cName());
stalker->movement().set_level_dest_vertex (level_vertex_id);
}
}