当前位置: 首页>>代码示例>>C++>>正文


C++ DirectDelete函数代码示例

本文整理汇总了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);
    }
}
开发者ID:3306665,项目名称:trinitycore,代码行数:10,代码来源:MotionMaster.cpp

示例2: while

MotionMaster::~MotionMaster()
{
    // clear ALL movement generators (including default)
    while(!empty())
    {
        MovementGenerator* pCurrentPosition = top();
        pop();
        if(pCurrentPosition)
            DirectDelete(pCurrentPosition);
    }
}
开发者ID:Darkelmo,项目名称:MythCore,代码行数:11,代码来源:MotionMaster.cpp

示例3: while

void MotionMaster::Initialize() {
	// clear ALL movement generators (including default)
	while (!empty()) {
		MovementGenerator *curr = top();
		pop();
		removeEmptyTops();
		if (curr)
			DirectDelete(curr);
	}

	InitDefault();
}
开发者ID:FrenchCORE,项目名称:Server,代码行数:12,代码来源:MotionMaster.cpp

示例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);
}
开发者ID:Bluedead,项目名称:SkyFireEMU,代码行数:14,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:m-uu,项目名称:ElunaTrinityWotlk,代码行数:16,代码来源:MotionMaster.cpp

示例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);
}
开发者ID:FrenchCORE,项目名称:Server,代码行数:18,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:martial69320,项目名称:cerberus,代码行数:20,代码来源:MotionMaster.cpp

示例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
}
开发者ID:Exodius,项目名称:chuspi,代码行数:41,代码来源:MotionMaster.cpp

示例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;
    }
}
开发者ID:Bluedead,项目名称:SkyFireEMU,代码行数:40,代码来源:MotionMaster.cpp

示例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;
    }
}
开发者ID:StarCore,项目名称:MythCore,代码行数:40,代码来源:MotionMaster.cpp

示例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);
    }
}
开发者ID:Bluedead,项目名称:SkyFireEMU,代码行数:22,代码来源:MotionMaster.cpp

示例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;
}
开发者ID:Bootz,项目名称:TC-One,代码行数:23,代码来源:MotionMaster.cpp

示例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);
    }
}
开发者ID:m-uu,项目名称:ElunaTrinityWotlk,代码行数:24,代码来源:MotionMaster.cpp

示例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;
    }
}
开发者ID:Bootz,项目名称:TC-One,代码行数:24,代码来源:MotionMaster.cpp


注:本文中的DirectDelete函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。