本文整理汇总了C++中setOnlineOfflineState函数的典型用法代码示例。如果您正苦于以下问题:C++ setOnlineOfflineState函数的具体用法?C++ setOnlineOfflineState怎么用?C++ setOnlineOfflineState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setOnlineOfflineState函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: link
void HostileReference::updateOnlineStatus()
{
bool online = false;
bool accessible = false;
if (!isValid())
if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()))
link(target, getSource());
// only check for online status if
// ref is valid
// target is no player or not gamemaster
// target is not in flight
if (isValid()
&& (getTarget()->GetTypeId() != TYPEID_PLAYER || !getTarget()->ToPlayer()->isGameMaster())
&& !getTarget()->HasUnitState(UNIT_STATE_IN_FLIGHT)
&& getTarget()->IsInMap(getSourceUnit())
&& getTarget()->InSamePhase(getSourceUnit())
)
{
Creature* creature = getSourceUnit()->ToCreature();
online = getTarget()->isInAccessiblePlaceFor(creature);
if (!online)
{
if (creature->IsWithinCombatRange(getTarget(), creature->m_CombatDistance))
online = true; // not accessible but stays online
}
else
accessible = true;
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
}
开发者ID:hallabro,项目名称:hallabro-trinity,代码行数:34,代码来源:ThreatManager.cpp
示例2: link
void HostileReference::updateOnlineStatus()
{
bool online = false;
bool accessible = false;
if (!isValid())
{
if (Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid()))
link(target, getSource());
}
// only check for online status if
// ref is valid
// target is no player or not gamemaster
// target is not in flight
if (isValid() &&
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
!getTarget()->IsTaxiFlying()))
{
Creature* creature = (Creature*) getSourceUnit();
online = getTarget()->isInAccessablePlaceFor(creature);
if (!online)
{
if (creature->AI()->canReachByRangeAttack(getTarget()))
online = true; // not accessable but stays online
}
else
accessible = true;
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:31,代码来源:ThreatManager.cpp
示例3: getUnitGuid
void HostilReference::updateOnlineStatus()
{
bool online = false;
bool accessible = false;
if(!isValid())
{
Unit* target = ObjectAccessor::GetUnit(*getSourceUnit(), getUnitGuid());
if(target)
link(target, getSource());
}
// only check for online status if
// ref is valid
// target is no player or not gamemaster
// target is not in flight
if(isValid() &&
((getTarget()->GetTypeId() != TYPEID_PLAYER || !((Player*)getTarget())->isGameMaster()) ||
!getTarget()->hasUnitState(UNIT_STAT_IN_FLIGHT)))
{
Creature* creature = (Creature* ) getSourceUnit();
online = getTarget()->isInAccessiblePlaceFor(creature);
if(!online)
{
if(creature->IsWithinCombatRange(getTarget(),MELEE_RANGE))
online = true; // not accessible but stays online
}
else
accessible = true;
}
setAccessibleState(accessible);
setOnlineOfflineState(online);
}
开发者ID:de-dima,项目名称:243,代码行数:33,代码来源:ThreatManager.cpp
示例4: setOnlineOfflineState
void HostileReference::sourceObjectDestroyLink()
{
setOnlineOfflineState(false);
}
开发者ID:AwkwardDev,项目名称:mangos-d3,代码行数:4,代码来源:ThreatManager.cpp
注:本文中的setOnlineOfflineState函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论