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


C# Geometry.IsInside方法代码示例

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


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

示例1: PriorityCast

        //-----------------------------------------------PriorityCast---------------------------------------------

        static void PriorityCast(Obj_AI_Base sender, GameObjectProcessSpellCastEventArgs args, List<AIHeroClient> Allies, Geometry.Polygon polygon)
        {
            int delay = new int();
            
            Allies.OrderBy(it => it.Distance(args.Start));

            var ally = Allies.First();

            if (Allies.Count == 1)
            {
                delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                Core.DelayAction(delegate
                {
                    if (polygon.IsInside(ally) && E.IsInRange(ally)) E.Cast(ally);
                    return;
                }, delay);
                
                //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                return;
            }
            else
            {
                if (CollisionSpells.Any(it => it == args.SData.Name))
                {
                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 300 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in Allies)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally)) { E.Cast(Ally); return; }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());

                    return;
                }

                else
                {
                    IEnumerable<AIHeroClient> priorities = from aliado in EntityManager.Heroes.Allies orderby EMenu[aliado.BaseSkinName].Cast<Slider>().CurrentValue descending select aliado;
                    
                    delay = (int)((sender.Distance(ally) / args.SData.MissileMaxSpeed * 1000) + args.SData.SpellCastTime - 200 - Game.Ping);

                    Core.DelayAction(delegate
                    {
                        foreach (var Ally in priorities)
                        {
                            if (polygon.IsInside(Ally) && E.IsInRange(Ally)) { E.Cast(Ally); return; }
                        }
                        return;
                    }, delay);

                    //Chat.Print("Shield for {0} : {1}", sender.BaseSkinName, args.Slot.ToString());
                    return;
                }
            }
        }
开发者ID:lolscripts,项目名称:wu,代码行数:63,代码来源:Program.cs

示例2: EnemiesHitInSectorAndRectangle

 public static int EnemiesHitInSectorAndRectangle(this Geometry.Polygon.Sector sector, Geometry.Polygon.Rectangle rect, List<Obj_AI_Base> enemies)
 {
     return enemies.Where(a => a.MeetsCriteria() && rect.IsInside(a)).Count();
 }
开发者ID:Sicryption,项目名称:EloBuddyAddons,代码行数:4,代码来源:CustomExtensions.cs


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