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


C++ Condition::endCondition方法代码示例

本文整理汇总了C++中Condition::endCondition方法的典型用法代码示例。如果您正苦于以下问题:C++ Condition::endCondition方法的具体用法?C++ Condition::endCondition怎么用?C++ Condition::endCondition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Condition的用法示例。


在下文中一共展示了Condition::endCondition方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: removeCondition

void Creature::removeCondition(ConditionType_t type, bool force/* = false*/)
{
	auto it = conditions.begin(), end = conditions.end();
	while (it != end) {
		Condition* condition = *it;
		if (condition->getType() != type) {
			++it;
			continue;
		}

		if (!force && type == CONDITION_PARALYZE) {
			int64_t walkDelay = getWalkDelay();
			if (walkDelay > 0) {
				g_scheduler.addEvent(createSchedulerTask(walkDelay, std::bind(&Game::forceRemoveCondition, &g_game, getID(), type)));
				return;
			}
		}

		it = conditions.erase(it);

		condition->endCondition(this);
		delete condition;

		onEndCondition(type);
	}
}
开发者ID:A-Syntax,项目名称:forgottenserver,代码行数:26,代码来源:creature.cpp

示例2: removeCondition

void Creature::removeCondition(ConditionType_t type, ConditionId_t id, bool force/* = false*/)
{
	ConditionList::iterator it = conditions.begin();
	while (it != conditions.end()) {
		Condition* condition = *it;
		if (condition->getType() != type || condition->getId() != id) {
			++it;
			continue;
		}

		if (!force && condition->getType() == CONDITION_PARALYZE) {
			int64_t walkDelay = getWalkDelay();
			if (walkDelay > 0) {
				g_scheduler.addEvent(createSchedulerTask(walkDelay, boost::bind(&Game::forceRemoveCondition, &g_game, getID(), type)));
				return;
			}
		}

		it = conditions.erase(it);

		condition->endCondition(this, CONDITIONEND_ABORT);
		delete condition;

		onEndCondition(type);
	}
}
开发者ID:afsdadsfdsa,项目名称:forgottenserver,代码行数:26,代码来源:creature.cpp

示例3: removeCondition

void Creature::removeCondition(Condition* condition)
{
	ConditionList::iterator it = std::find(conditions.begin(), conditions.end(), condition);
	if(it != conditions.end())
	{
		Condition* condition = *it;
		it = conditions.erase(it);

		condition->endCondition(this, CONDITIONEND_ABORT);
		onEndCondition(condition->getType());
		delete condition;
	}
}
开发者ID:Azuen,项目名称:RealOTX-7.72,代码行数:13,代码来源:creature.cpp

示例4: executeConditions

void Creature::executeConditions(uint32_t interval)
{
	for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); )
	{
		if((*it)->executeCondition(this, interval))
		{
			++it;
			continue;
		}

		Condition* condition = *it;
		it = conditions.erase(it);

		condition->endCondition(this, CONDITIONEND_TICKS);
		onEndCondition(condition->getType());
		delete condition;
	}
}
开发者ID:Azuen,项目名称:RealOTX-7.72,代码行数:18,代码来源:creature.cpp

示例5: removeConditions

void Creature::removeConditions(ConditionEnd_t reason, bool onlyPersistent/* = true*/)
{
	for(ConditionList::iterator it = conditions.begin(); it != conditions.end(); )
	{
		if(onlyPersistent && !(*it)->isPersistent())
		{
			++it;
			continue;
		}

		Condition* condition = *it;
		it = conditions.erase(it);

		condition->endCondition(this, reason);
		onEndCondition(condition->getType());
		delete condition;
	}
}
开发者ID:Azuen,项目名称:RealOTX-7.72,代码行数:18,代码来源:creature.cpp

示例6: executeConditions

void Creature::executeConditions(uint32_t interval)
{
	for (ConditionList::iterator it = conditions.begin(); it != conditions.end();) {
		if (!(*it)->executeCondition(this, interval)) {
			Condition* condition = *it;

			ConditionType_t type = condition->getType();

			it = conditions.erase(it);

			condition->endCondition(this, CONDITIONEND_TICKS);
			delete condition;

			onEndCondition(type);
		} else {
			++it;
		}
	}
}
开发者ID:afsdadsfdsa,项目名称:forgottenserver,代码行数:19,代码来源:creature.cpp

示例7: executeConditions

void Creature::executeConditions(uint32_t interval)
{
	auto it = conditions.begin(), end = conditions.end();
	while (it != end) {
		Condition* condition = *it;
		if (!condition->executeCondition(this, interval)) {
			ConditionType_t type = condition->getType();

			it = conditions.erase(it);

			condition->endCondition(this);
			delete condition;

			onEndCondition(type);
		} else {
			++it;
		}
	}
}
开发者ID:A-Syntax,项目名称:forgottenserver,代码行数:19,代码来源:creature.cpp


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