本文整理汇总了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;
}
}
}
示例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();
}