本文整理汇总了C++中setAccessibleState函数的典型用法代码示例。如果您正苦于以下问题:C++ setAccessibleState函数的具体用法?C++ setAccessibleState怎么用?C++ setAccessibleState使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAccessibleState函数的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 || !((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);
}
示例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 || !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);
}
示例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);
}
示例4: setAccessibleState
void HostilReference::setOnlineOfflineState(bool pIsOnline)
{
if(iOnline != pIsOnline)
{
iOnline = pIsOnline;
if(!iOnline)
setAccessibleState(false); // if not online that not accessible as well
fireStatusChanged(ThreatRefStatusChangeEvent(UEV_THREAT_REF_ONLINE_STATUS, this));
}
}