本文整理汇总了C#中WoWUnit.IsNeutral方法的典型用法代码示例。如果您正苦于以下问题:C# WoWUnit.IsNeutral方法的具体用法?C# WoWUnit.IsNeutral怎么用?C# WoWUnit.IsNeutral使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWUnit
的用法示例。
在下文中一共展示了WoWUnit.IsNeutral方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CheckTarget
private void CheckTarget(WoWUnit unit, ref WoWGuid prevGuid, string description, OnTargetChange onchg)
{
// there are moments where CurrentTargetGuid != 0 but CurrentTarget == null. following
// .. tries to handle by only checking CurrentTarget reference and treating null as guid = 0
if (unit == null)
{
if (prevGuid.IsValid)
{
prevGuid = WoWGuid.Empty;
onchg(unit);
if (SingularSettings.Debug)
Logger.WriteDebug(description + ": changed to: (null)");
}
}
else if (unit.Guid != prevGuid)
{
prevGuid = unit.Guid;
onchg(unit);
if (SingularSettings.Debug)
{
//Logger.WriteDebug( "GuidInfo: {0}", unit.Guid.ToString());
//Logger.WriteDebug("GuidInfo: {0:X4} {1:X4} {2:X4} {3:X4}", unit.Guid.Highest, unit.Guid.Higher, unit.Guid.Lower, unit.Guid.Lowest);
string info = "";
if (Styx.CommonBot.POI.BotPoi.Current.Guid == Me.CurrentTargetGuid)
info += string.Format(", IsBotPoi={0}", Styx.CommonBot.POI.BotPoi.Current.Type);
if (Styx.CommonBot.Targeting.Instance.TargetList.Contains(Me.CurrentTarget))
info += string.Format(", TargetIndex={0}", Styx.CommonBot.Targeting.Instance.TargetList.IndexOf(Me.CurrentTarget) + 1);
string playerInfo = "N";
if (unit.IsPlayer)
{
WoWPlayer p = unit.ToPlayer();
playerInfo = string.Format("Y, Friend={0}, IsPvp={1}, CtstPvp={2}, FfaPvp={3}", Me.IsHorde == p.IsHorde, p.IsPvPFlagged, p.ContestedPvPFlagged, p.IsFFAPvPFlagged);
}
else
{
info += string.Format(", creature={0}, tagme={1}, tagother={2}, tapall={3}",
unit.CreatureType,
unit.TaggedByMe.ToYN(),
unit.TaggedByOther.ToYN(),
unit.TappedByAllThreatLists.ToYN()
);
}
Logger.WriteDebug(description + ": changed to: {0} lvl={1} h={2:F1}%, maxh={3}, d={4:F1} yds, box={5:F1}, boss={6}, trivial={7}, player={8}, attackable={9}, neutral={10}, hostile={11}, entry={12}, faction={13}, loss={14}, facing={15}, blacklist={16}, combat={17}, flying={18}, abovgrnd={19}" + info,
unit.SafeName(),
unit.Level,
unit.HealthPercent,
unit.MaxHealth,
unit.Distance,
unit.CombatReach,
unit.IsBoss().ToYN(),
unit.IsTrivial().ToYN(),
playerInfo,
unit.Attackable.ToYN(),
unit.IsNeutral().ToYN(),
unit.IsHostile.ToYN(),
unit.Entry,
unit.FactionId,
unit.InLineOfSpellSight.ToYN(),
Me.IsSafelyFacing(unit).ToYN(),
Blacklist.Contains(unit.Guid, BlacklistFlags.Combat).ToYN(),
unit.Combat.ToYN(),
unit.IsFlying.ToYN(),
unit.IsAboveTheGround().ToYN()
);
}
}
}
示例2: CheckTarget
private void CheckTarget(WoWUnit unit, ref ulong prevGuid, string description)
{
// there are moments where CurrentTargetGuid != 0 but CurrentTarget == null. following
// .. tries to handle by only checking CurrentTarget reference and treating null as guid = 0
if (unit == null)
{
if (prevGuid != 0)
{
prevGuid = 0;
Logger.WriteDebug(description + ": changed to: (null)");
HandleTrainingDummy(unit);
}
}
else if (unit.Guid != prevGuid)
{
prevGuid = unit.Guid;
HandleTrainingDummy(unit);
string info = "";
if (Styx.CommonBot.POI.BotPoi.Current.Guid == Me.CurrentTargetGuid)
info += string.Format(", IsBotPoi={0}", Styx.CommonBot.POI.BotPoi.Current.Type);
if (Styx.CommonBot.Targeting.Instance.TargetList.Contains(Me.CurrentTarget))
info += string.Format(", TargetIndex={0}", Styx.CommonBot.Targeting.Instance.TargetList.IndexOf(Me.CurrentTarget) + 1);
string playerInfo = "N";
if (unit.IsPlayer)
{
WoWPlayer p = unit.ToPlayer();
playerInfo = string.Format("Y, Friend={0}, IsPvp={1}, CtstPvp={2}, FfaPvp={3}", Me.IsHorde == p.IsHorde, p.IsPvPFlagged, p.ContestedPvPFlagged, p.IsFFAPvPFlagged);
}
Logger.WriteDebug(description + ": changed to: {0} h={1:F1}%, maxh={2}, d={3:F1} yds, box={4:F1}, trivial={5}, player={6}, attackable={7}, neutral={8}, hostile={9}, entry={10}, faction={11}, loss={12}, facing={13}, blacklist={14}, combat={15}" + info,
unit.SafeName(),
unit.HealthPercent,
unit.MaxHealth,
unit.Distance,
unit.CombatReach,
unit.IsTrivial(),
playerInfo,
unit.Attackable.ToYN(),
unit.IsNeutral().ToYN(),
unit.IsHostile.ToYN(),
unit.Entry,
unit.FactionId,
unit.InLineOfSpellSight.ToYN(),
Me.IsSafelyFacing(unit).ToYN(),
Blacklist.Contains(unit.Guid, BlacklistFlags.Combat).ToYN(),
unit.Combat.ToYN()
);
}
}