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


C++ ThreatMapEntry::getHeal方法代码示例

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


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

示例1: removeAll

void ThreatMap::removeAll(bool forceRemoveAll) {
	Locker locker(&lockMutex);

	removeObservers();

	for (int i = size() - 1; i >= 0; i--) {
		VectorMapEntry<ManagedReference<CreatureObject*> , ThreatMapEntry> *entry = &elementAt(i);

		ManagedReference<CreatureObject*> key = entry->getKey();
		ThreatMapEntry *value = &entry->getValue();

		ManagedReference<TangibleObject*> selfStrong = self.get();

		// these checks will determine if we should store the damage from the dropped aggressor
		Zone* keyZone = (key != NULL ? key->getZone() : NULL);
		Zone* selfZone = (selfStrong != NULL ? selfStrong->getZone() : NULL);

		uint32 keyPlanetCRC = (keyZone != NULL ? keyZone->getPlanetCRC() : 0);
		uint32 selfPlanetCRC = (selfZone != NULL ? selfZone->getPlanetCRC() : 0);

		if (key == NULL || selfStrong == NULL || key->isDead() || !key->isOnline() || keyPlanetCRC != selfPlanetCRC || forceRemoveAll) {
			remove(i);

			if (threatMapObserver != NULL)
				key->dropObserver(ObserverEventType::HEALINGPERFORMED, threatMapObserver);
		} else {
			value->setNonAggroDamage(value->getTotalDamage());
			value->addHeal(-value->getHeal()); // don't need to store healing
			value->clearAggro();
		}
	}

	currentThreat = NULL;
	threatMatrix.clear();
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:35,代码来源:ThreatMap.cpp

示例2: dropDamage

void ThreatMap::dropDamage(CreatureObject* target) {
	Locker llocker(&lockMutex);

	ManagedReference<TangibleObject*> selfStrong = self.get();
	if (target == NULL || selfStrong == NULL || target->isDead() || !target->isOnline() || target->getPlanetCRC() != selfStrong->getPlanetCRC()) {
		drop(target);

		if (threatMapObserver != NULL)
			target->dropObserver(ObserverEventType::HEALINGPERFORMED, threatMapObserver);
	} else {
		ThreatMapEntry *entry = &get(target);
		entry->setNonAggroDamage(entry->getTotalDamage());
		entry->addHeal(-entry->getHeal()); // don't need to store healing
		entry->clearAggro();
	}

	llocker.release();

	if (currentThreat == target)
		currentThreat = NULL;
}
开发者ID:JigglyPoofSWG,项目名称:BSS,代码行数:21,代码来源:ThreatMap.cpp


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