本文整理汇总了C++中Action::Abort方法的典型用法代码示例。如果您正苦于以下问题:C++ Action::Abort方法的具体用法?C++ Action::Abort怎么用?C++ Action::Abort使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Action
的用法示例。
在下文中一共展示了Action::Abort方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void IStrategizer::OnlinePlanExpansionExecution::UpdateActionNode(_In_ IOlcbpPlan::NodeID currentNode, _In_ const WorldClock& clock)
{
_ASSERTE(IsNodeReady(currentNode));
_ASSERTE(IsActionNode(currentNode));
Action *pAction = (Action*)m_pOlcbpPlan->GetNode(currentNode);
if (!IsNodeDone(currentNode))
{
_ASSERTE(pAction->GetState() == ESTATE_NotPrepared ||
pAction->GetState() == ESTATE_Executing ||
pAction->GetState() == ESTATE_END);
if (pAction->GetState() == ESTATE_END)
MarkActionAsActive(currentNode);
pAction->Update(*g_Game, clock);
if (pAction->GetState() == ESTATE_Succeeded)
{
OnActionNodeSucceeded(currentNode);
}
else if (pAction->GetState() == ESTATE_Failed)
{
if (pAction->SleepsCount() < ActionMaxSleepsCount)
{
LogInfo("%s failed execution, but will reset it and send it to sleep", pAction->ToString().c_str(), pAction->SleepsCount());
pAction->Abort(*g_Game);
pAction->Reset(*g_Game, clock);
pAction->Sleep(clock, ActionSleepTime);
}
else
{
LogInfo("%s failed execution, already tried to sleep it %d time(s) before, failing it", pAction->ToString().c_str(), ActionMaxSleepsCount);
OnActionNodeFailed(currentNode);
}
}
}
}