本文整理汇总了C++中CAction::reset方法的典型用法代码示例。如果您正苦于以下问题:C++ CAction::reset方法的具体用法?C++ CAction::reset怎么用?C++ CAction::reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CAction
的用法示例。
在下文中一共展示了CAction::reset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
CAction *CActionFactory::create (TCLEntityId slot, TActionCode code)
{
if (RegisteredAction.size() <= code || RegisteredAction[code].first == NULL)
{
nlwarning ("CActionFactory::create() try to create an unknown action (%u)", code);
return NULL;
}
else if (RegisteredAction[code].second.empty())
{
// no action left in the store
CAction *action = RegisteredAction[code].first (); // execute the factory function
//nlinfo( "No action in store for code %u, creating action (total %u, total for code %u)", code, getNbActionsInStore(), getNbActionsInStore(action->Code) );
action->Code = code;
action->PropertyCode = code; // default, set the property code to the action code (see create(TProperty,TPropIndex))
action->Slot = slot;
action->reset();
return action;
}
else
{
// pop an action off the store
CAction *action = RegisteredAction[code].second.back();
//nlinfo( "Found action in store for code %u (total %u, total for code %u)", code, getNbActionsInStore(), getNbActionsInStore(action->Code) );
RegisteredAction[code].second.pop_back();
action->reset();
action->Slot = slot;
action->PropertyCode = code;
return action;
}
}