本文整理汇总了C++中DirectDelete函数的典型用法代码示例。如果您正苦于以下问题:C++ DirectDelete函数的具体用法?C++ DirectDelete怎么用?C++ DirectDelete使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DirectDelete函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
MotionMaster::~MotionMaster()
{
// clear ALL movement generators (including default)
while (!empty())
{
MovementGenerator *curr = top();
pop();
if (curr) DirectDelete(curr);
}
}
示例2: while
MotionMaster::~MotionMaster()
{
// clear ALL movement generators (including default)
while(!empty())
{
MovementGenerator* pCurrentPosition = top();
pop();
if(pCurrentPosition)
DirectDelete(pCurrentPosition);
}
}
示例3: while
void MotionMaster::Initialize() {
// clear ALL movement generators (including default)
while (!empty()) {
MovementGenerator *curr = top();
pop();
removeEmptyTops();
if (curr)
DirectDelete(curr);
}
InitDefault();
}
示例4: while
void MotionMaster::DirectClean(bool reset)
{
while (size() > 1)
{
MovementGenerator *curr = top();
pop();
if (curr) DirectDelete(curr);
}
if (needInitTop())
InitTop();
else if (reset)
top()->Reset(*_owner);
}
示例5: DirectDelete
void MotionMaster::ClearExpireList()
{
for (auto itr : _expireList)
DirectDelete(itr);
_expireList.clear();
if (empty())
Initialize();
else if (NeedInitTop())
InitTop();
else if (_cleanFlag & MOTIONMMASTER_CLEANFLAG_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MOTIONMMASTER_CLEANFLAG_RESET;
}
示例6: top
void MotionMaster::DirectExpire(bool reset) {
if (size() > 1) {
MovementGenerator *curr = top();
pop();
removeEmptyTops();
DirectDelete(curr);
}
while (!top())
--i_top;
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (reset)
top()->Reset(*i_owner);
}
示例7: DirectDelete
void MotionMaster::ClearExpireList()
{
for (size_t i = 0; i < _expireList->size(); ++i)
{
MovementGenerator* mg = (*_expireList)[i];
DirectDelete(mg);
}
delete _expireList;
_expireList = nullptr;
if (empty())
Initialize();
else if (NeedInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MMCF_RESET;
}
示例8: ASSERT
void MotionMaster::UpdateMotion(uint32 diff)
{
if (!_owner)
return;
if (_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
return;
ASSERT(!empty());
_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(_owner, diff))
{
_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
}
else
_cleanFlag &= ~MMCF_UPDATE;
if (!_expList.empty())
{
for (ExpireList::iterator i = _expList.begin(); i != _expList.end(); ++i)
DirectDelete(*i);
_expList.clear();
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(_owner);
_cleanFlag &= ~MMCF_RESET;
}
#if 0
// probably not the best place to pu this but im not really sure where else to put it.
_owner->UpdateUnderwaterState(_owner->GetMap(), _owner->GetPositionX(), _owner->GetPositionY(), _owner->GetPositionZ());
#endif
}
示例9: ASSERT
void MotionMaster::UpdateMotion(uint32 diff)
{
if (!_owner)
return;
if (_owner->HasUnitState(UNIT_STATE_ROOT | UNIT_STATE_STUNNED)) // what about UNIT_STATE_DISTRACTED? Why is this not included?
return;
ASSERT(!empty());
_cleanFlag |= MMCF_UPDATE;
if (!top()->Update(*_owner, diff))
{
_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
}
else
_cleanFlag &= ~MMCF_UPDATE;
if (_expList)
{
for (size_t i = 0; i < _expList->size(); ++i)
{
MovementGenerator* mg = (*_expList)[i];
DirectDelete(mg);
}
delete _expList;
_expList = NULL;
if (empty())
Initialize();
else if (needInitTop())
InitTop();
else if (_cleanFlag & MMCF_RESET)
top()->Reset(*_owner);
_cleanFlag &= ~MMCF_RESET;
}
}
示例10: ASSERT
void MotionMaster::UpdateMotion(uint32 diff)
{
if(!i_owner)
return;
if(i_owner->HasUnitState(UNIT_STAT_ROOT | UNIT_STAT_STUNNED))
return;
ASSERT(!empty());
m_cleanFlag |= MMCF_UPDATE;
if(!top()->Update(*i_owner, diff))
{
m_cleanFlag &= ~MMCF_UPDATE;
MovementExpired();
}
else
m_cleanFlag &= ~MMCF_UPDATE;
if(m_expList)
{
for(size_t i = 0; i < m_expList->size(); ++i)
{
MovementGenerator* mg = (*m_expList)[i];
DirectDelete(mg);
}
delete m_expList;
m_expList = NULL;
if(empty())
Initialize();
else if(needInitTop())
InitTop();
else if(m_cleanFlag & MMCF_RESET)
top()->Reset(*i_owner);
m_cleanFlag &= ~MMCF_RESET;
}
}
示例11: DelayedDelete
void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
{
if (MovementGenerator *curr = Impl[slot])
{
Impl[slot] = NULL; // in case a new one is generated in this slot during direct delete
if (_top == slot && (_cleanFlag & MMCF_UPDATE))
DelayedDelete(curr);
else
DirectDelete(curr);
}
else if (_top < slot)
_top = slot;
Impl[slot] = m;
if (_top > slot)
_needInit[slot] = true;
else
{
_needInit[slot] = false;
m->Initialize(*_owner);
}
}
示例12: DelayedDelete
void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
{
if(MovementGenerator *curr = Impl[slot])
{
if(i_top == slot && (m_cleanFlag & MMCF_UPDATE))
DelayedDelete(curr);
else
DirectDelete(curr);
}
else if(i_top < slot)
{
i_top = slot;
}
if(i_top > slot)
needInit[slot] = true;
else
{
m->Initialize(*i_owner);
needInit[slot] = false;
}
Impl[slot] = m;
}
示例13: DelayedDelete
void MotionMaster::Mutate(MovementGenerator *m, MovementSlot slot)
{
if (MovementGenerator* curr = _slot[slot])
{
_slot[slot] = nullptr; // in case a new one is generated in this slot during directdelete
if (_top == slot && (_cleanFlag & MOTIONMMASTER_CLEANFLAG_UPDATE))
DelayedDelete(curr);
else
DirectDelete(curr);
}
else if (_top < slot)
{
_top = slot;
}
_slot[slot] = m;
if (_top > slot)
_initialize[slot] = true;
else
{
_initialize[slot] = false;
m->Initialize(_owner);
}
}
示例14: while
void
MotionMaster::Initialize()
{
// clear ALL movement generators (including default)
while(!empty())
{
MovementGenerator *curr = top();
pop();
if(curr) DirectDelete(curr);
}
// set new default movement generator
if(i_owner->GetTypeId() == TYPEID_UNIT)
{
MovementGenerator* movement = FactorySelector::selectMovementGenerator((Creature*)i_owner);
push( movement == NULL ? &si_idleMovement : movement );
InitTop();
}
else
{
push(&si_idleMovement);
needInit[MOTION_SLOT_IDLE] = false;
}
}