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


C# WoWPoint.Distance2D方法代码示例

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


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

示例1: GoToLocation_MouseDown

        private void GoToLocation_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                Location locationItem = null;
                int closestLocation = 999999999;

                //Logging.Write("inside mouse click ok");

                foreach (Location loc in LocationList.Items)
                {
                    WoWPoint destination = new WoWPoint(float.Parse(loc.X), float.Parse(loc.Y), float.Parse(loc.Z));
                    int distanceToLocation = (int)destination.Distance2D(ObjectManager.Me.Location);
                    if (distanceToLocation < closestLocation) 
                    {
                        locationItem = loc;
                        closestLocation = distanceToLocation;
                    }
                }

                if (!Equals(null, locationItem)) LocationList.SelectedItem = locationItem;


            }

        }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:26,代码来源:UI.cs

示例2: CreateBehavior

 protected override Composite CreateBehavior()
 {
     return _root ?? (_root = new PrioritySelector(
         new Decorator(ret => IsDone, new Action(c => {
             TreeRoot.StatusText = "The Humanoid Cannonball complete!";
         })),
         new Decorator(ret => HasBuff, new PrioritySelector(
             new Decorator(ret => !_hadWings, new Action(c => {
                 _hadWings = true;
                 LogMessage("debug", "Got wings buff.");
             })),
             new Decorator(ret => BuffDuration <= (CancelTimeLeft + _latency), new Action(c => {
                 LogMessage("debug", "Cancelling wings with {0}s left. CancelTime+Latency = {1} + {2} = {3}", BuffDuration, CancelTimeLeft, _latency, CancelTimeLeft + _latency);
                 TreeRoot.StatusText = "Cancelling wings.";
                 PerformAction(ActionButton);
             })),
             new Action(c => {
                 TreeRoot.StatusText = "Waiting to cancel wings.";
             })
         )),
         new Decorator(ret => _started && _hadWings && !HasBuff, new PrioritySelector(
             new Decorator(ret => Me.IsFalling, new Action(c => {
                 TreeRoot.StatusText = "Waiting to land.";
             })),
             new Decorator(ret => WoWPoint.Empty == _landPoint && !Me.IsMoving, new Action(c => {
                 _landPoint = Me.Location;
                 LogMessage("info", "Landed {0} yards from bullseye.", _landPoint.Distance2D(BullseyePoint));
             })),
             new Decorator(ret => WoWPoint.Empty == _landPoint, new ActionAlwaysSucceed()),
             new Decorator(ret => null == TeleportNpc, new Action(c => {
                 TreeRoot.StatusText = "Waiting for teleport npc to load.";
             })),
             new Decorator(ret => TeleportNpc.DistanceSqr < DistanceCheckSqr, new Sequence(
                 new Action(c => {
                     TreeRoot.StatusText = "Teleporting back to cannon.";
                     TeleportNpc.Interact();
                     Thread.Sleep(2000);
                 }),
                 new Action(c => {
                     if (UseTeleport && Me.Silver >= TeleportCostSilver) {
                         GossipFrame.Instance.SelectGossipOption(TeleportGossipOption);
                         Thread.Sleep(1000);
                         Lua.DoString("StaticPopup1Button1:Click()"); // accept cost
                     }
                 }),
                 new Action(c => { _isDone = true; })
             )),
             new Action(c => {
                 TreeRoot.StatusText = "Moving to teleport back.";
                 //WoWMovement.ClickToMove(TeleportNpc.Location);
                 Navigator.MoveTo(TeleportNpc.Location);
             })
         )),
         new Decorator(ret => !_started, new PrioritySelector(
             new Decorator(ret => !HasGameToken, new Action(c => {
                 LogMessage("error", "No game tokens, skipping cannon.");
                 _isDone = true; // Can't play the game without a token
             })),
             new Decorator(ret => Npc.DistanceSqr > Npc.InteractRangeSqr, new Action(c => {
                 Navigator.MoveTo(Npc.Location);
             })),
             new Sequence(
                 new Action(c => {
                     //using (new FrameLock()) { // FIXME
                         foreach (int buffId in BadBuffIds) {
                             if (Me.HasAura(buffId)) {
                                 CancelBuff(buffId);
                             }
                         }
                     //}
                 }),
                 new Action(c => {
                     Npc.Interact();
                     Thread.Sleep(2000);
                     GossipFrame.Instance.SelectGossipOption(GossipOption);
                     Thread.Sleep(1000);
                     _started = true;
                 })
             )
         )),
         new Action(c => { TreeRoot.StatusText = "Waiting to get wings."; })
     ));
 }
开发者ID:timglide,项目名称:hb-profiles,代码行数:83,代码来源:DMF_Cannon.cs

示例3: Locations_SelectedIndexChanged

        private void Locations_SelectedIndexChanged(object sender, EventArgs e)
        {
            Location loc = (Location) LocationList.SelectedItem;
            WoWPoint destination = new WoWPoint(float.Parse(loc.X), float.Parse(loc.Y), float.Parse(loc.Z));
            int distanceToDestination = (int)destination.Distance2D(ObjectManager.Me.Location);
            //string distanceToDest = "";


            statusLabel.Text = string.Format("{0} ({1}) in {2} is {3} yards", loc.Name, loc.Category, loc.Zone, distanceToDestination);

            //statuslabel.Text = loc.Name + subzone + zone;
        }
开发者ID:Borgsen,项目名称:celisuis-honorbuddy-pack,代码行数:12,代码来源:UI.cs


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