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


C# WoWUnit.IsTrivial方法代码示例

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


在下文中一共展示了WoWUnit.IsTrivial方法的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()
                        );
                }
            }
        }
开发者ID:aash,项目名称:Singular,代码行数:71,代码来源:SingularRoutine.cs

示例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()
                    );
            }
        }
开发者ID:superkhung,项目名称:SingularMod3,代码行数:54,代码来源:SingularRoutine.cs


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