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


C++ CEntityAlive::tfGetRelationType方法代码示例

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


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

示例1: Level

void CSoundMemoryManager::add			(const CObject *object, int sound_type, const Fvector &position, float sound_power)
{
#ifndef SAVE_OWN_SOUNDS
	// we do not want to save our own sounds
	if (object && (m_object->ID() == object->ID()))
		return;
#endif

#ifndef SAVE_OWN_ITEM_SOUNDS
	// we do not want to save the sounds which was from the items we own
	if (object && object->H_Parent() && (object->H_Parent()->ID() == m_object->ID()))
		return;
#endif

#ifndef SAVE_NON_ALIVE_OBJECT_SOUNDS
	// we do not want to save sounds from the non-alive objects (?!)
	if (object && !m_object->memory().enemy().selected() && !smart_cast<const CEntityAlive*>(object))
		return;
#endif

#ifndef SAVE_FRIEND_ITEM_SOUNDS
	// we do not want to save sounds from the teammates items
	CEntityAlive	*me				= m_object;
	if (object && object->H_Parent() && (me->tfGetRelationType(smart_cast<const CEntityAlive*>(object->H_Parent())) == ALife::eRelationTypeFriend))
		return;
#endif

#ifndef SAVE_FRIEND_SOUNDS
	const CEntityAlive	*entity_alive	= smart_cast<const CEntityAlive*>(object);
	// we do not want to save sounds from the teammates
	if (entity_alive && me && (me->tfGetRelationType(entity_alive) == ALife::eRelationTypeFriend))
		return;
#endif

#ifndef SAVE_VISIBLE_OBJECT_SOUNDS
#	ifdef SAVE_FRIEND_SOUNDS
		const CEntityAlive	*entity_alive	= smart_cast<const CEntityAlive*>(object);
#	endif
	// we do not save sounds from the objects we see (?!)
	if (m_object->memory().visual().visible_now(entity_alive))
		return;
#endif

	const CGameObject		*game_object = smart_cast<const CGameObject*>(object);
	if (!game_object && object)
		return;

	const CGameObject		*self = m_object;

	xr_vector<CSoundObject>::iterator	J = std::find(m_sounds->begin(),m_sounds->end(),object_id(object));
	if (m_sounds->end() == J) {
		CSoundObject			sound_object;

		sound_object.fill		(game_object,self,ESoundTypes(sound_type),sound_power,!m_stalker ? squad_mask_type(-1) : m_stalker->agent_manager().member().mask(m_stalker));
		if (!game_object)
			sound_object.m_object_params.m_position = position;
#ifdef USE_FIRST_GAME_TIME
		sound_object.m_first_game_time	= Level().GetGameTime();
#endif
#ifdef USE_FIRST_LEVEL_TIME
		sound_object.m_first_level_time	= Device.dwTimeGlobal;
#endif
		add						(sound_object);
	}
	else {
		(*J).fill				(game_object,self,ESoundTypes(sound_type),sound_power,(!m_stalker ? (*J).m_squad_mask.get() : ((*J).m_squad_mask.get() | m_stalker->agent_manager().member().mask(m_stalker))));
		if (!game_object)
			(*J).m_object_params.m_position = position;
	}
}
开发者ID:AntonioModer,项目名称:xray-16,代码行数:70,代码来源:sound_memory_manager.cpp


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