本文整理汇总了C++中ConCommandBase::SetNext方法的典型用法代码示例。如果您正苦于以下问题:C++ ConCommandBase::SetNext方法的具体用法?C++ ConCommandBase::SetNext怎么用?C++ ConCommandBase::SetNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConCommandBase
的用法示例。
在下文中一共展示了ConCommandBase::SetNext方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Unregister
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
{
#if SOURCE_ENGINE >= SE_ORANGEBOX
icvar->UnregisterConCommand(pCommand);
#else
ConCommandBase *pCur = NULL;
ConCommandBase *pPrev = NULL;
if (!pCommand)
{
return;
}
pCur = icvar->GetCommands();
if (!m_TopConCommandBase || !pCur)
{
return;
}
if (pCur == pCommand)
{
*m_TopConCommandBase = const_cast<ConCommandBase *>(pCommand->GetNext());
pCommand->SetNext(NULL);
return;
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
while (pCur)
{
if (pCur == pCommand)
{
pPrev->SetNext(const_cast<ConCommandBase *>(pCommand->GetNext()));
pCommand->SetNext(NULL);
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
}
#endif
}
示例2: Unregister
void SMConVarAccessor::Unregister(ConCommandBase *pCommand)
{
ConCommandBase *pCur = NULL;
ConCommandBase *pPrev = NULL;
if (!pCommand || !pCommand->IsRegistered())
{
return;
}
pCur = g_Engine.icvar->GetCommands();
pCommand->SetRegistered(false);
if (!m_TopConCommandBase || !pCur)
{
return;
}
if (pCur == pCommand)
{
*m_TopConCommandBase = const_cast<ConCommandBase *>(pCommand->GetNext());
pCommand->SetNext(NULL);
return;
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
while (pCur)
{
if (pCur == pCommand)
{
pPrev->SetNext(const_cast<ConCommandBase *>(pCommand->GetNext()));
pCommand->SetNext(NULL);
}
pPrev = pCur;
pCur = const_cast<ConCommandBase *>(pCur->GetNext());
}
}