本文整理汇总了C#中LeagueSharp.Common.Geometry.Polygon.Circle类的典型用法代码示例。如果您正苦于以下问题:C# Geometry.Polygon.Circle类的具体用法?C# Geometry.Polygon.Circle怎么用?C# Geometry.Polygon.Circle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Geometry.Polygon.Circle类属于LeagueSharp.Common命名空间,在下文中一共展示了Geometry.Polygon.Circle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreate
private static void OnCreate(GameObject sender, EventArgs args)
{
// Game.PrintChat(sender.Name);
if (sender.Name.ToLower().Contains("veigar_base_e_cage"))
{
Cage = sender;
if (Cage != null)
newCircle = new Geometry.Polygon.Circle(Cage.Position, 450);
}
}
示例2: GetDashPosition
public static Vector3 GetDashPosition(Spell spell, Obj_AI_Hero target, float safetyDistance)
{
var distance = target.Distance(ObjectManager.Player);
var dashPoints = new Geometry.Polygon.Circle(ObjectManager.Player.Position, spell.Range).Points;
if (distance < safetyDistance)
{
dashPoints.AddRange(
new Geometry.Polygon.Circle(ObjectManager.Player.Position, safetyDistance - distance).Points);
}
dashPoints = dashPoints.Where(p => !p.IsWall()).OrderBy(p => p.Distance(Game.CursorPos)).ToList();
foreach (var point in dashPoints)
{
var allies =
GameObjects.AllyHeroes.Where(
hero => !hero.IsDead && hero.Distance(point.To3D()) < ObjectManager.Player.AttackRange).ToList();
var enemies =
GameObjects.EnemyHeroes.Where(
hero => hero.IsValidTarget(ObjectManager.Player.AttackRange, true, point.To3D())).ToList();
var lowEnemies = enemies.Where(hero => hero.HealthPercent <= 15).ToList();
if (!point.To3D().IsUnderTurret(false))
{
if (enemies.Count == 1 &&
(!target.IsMelee ||
(target.HealthPercent <= ObjectManager.Player.HealthPercent - 25 ||
target.Position.Distance(point.To3D()) >= safetyDistance)) ||
allies.Count >
enemies.Count -
(ObjectManager.Player.HealthPercent >= (10 * lowEnemies.Count) ? lowEnemies.Count : 0))
{
return point.To3D();
}
}
else
{
if (enemies.Count == 1 && lowEnemies.Any(t => t.NetworkId.Equals(target.NetworkId)))
{
return point.To3D();
}
}
}
return Vector3.Zero;
}
示例3: OnCreate
private static void OnCreate(GameObject sender, EventArgs args)
{
// if (args == EventArgs.Empty) return;
// Game.PrintChat(sender.Name);
if (sender.Name.ToLower().Contains("gragas_base_q"))
{
if (sender.Name.ToLower().Contains("ally"))
{
Barrel = sender;
if (Barrel != null)
CirclePoly = new Geometry.Polygon.Circle(Barrel.Position, 300);
}
if (!sender.Name.ToLower().Contains("end")) return;
Barrel = null;
CirclePoly = null;
}
}
示例4: GetUltimateExplosionHits
/// <summary>
/// Get the ultimate explosion hit count with best location
/// </summary>
/// <param name="target"></param>
/// <returns></returns>
private Tuple<int, List<Obj_AI_Hero>, Vector3> GetUltimateExplosionHits(Obj_AI_Hero target)
{
var hits = new List<Obj_AI_Hero>();
var castPosition = Vector3.Zero;
try
{
var prediction = R.GetPrediction(target);
if (prediction.Hitchance >= R.GetHitChance("combo"))
{
castPosition = prediction.CastPosition;
hits.Add(target);
var explosion = new PredictionInput
{
Range = UltimateExplosion.Range,
Delay = Player.Position.Distance(castPosition) / R.Speed + 0.1f,
From = castPosition,
RangeCheckFrom = castPosition,
Radius = UltimateExplosion.Width,
Type = SkillshotType.SkillshotCircle,
Speed = UltimateExplosion.Speed
};
var explosionCircle = new Geometry.Polygon.Circle(castPosition, UltimateExplosion.Width);
foreach (var enemy in GameObjects.EnemyHeroes.Where(e => e.IsValidTarget() && e.NetworkId != target.NetworkId))
{
explosion.Unit = enemy;
var explosionPrediction = Prediction.GetPrediction(explosion);
if (!explosionPrediction.UnitPosition.Equals(Vector3.Zero))
{
var enemyPosition = new Geometry.Polygon.Circle(enemy.Position, enemy.BoundingRadius);
if (enemyPosition.Points.Any(p => explosionCircle.IsInside(p)))
{
hits.Add(enemy);
}
}
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, List<Obj_AI_Hero>, Vector3>(hits.Count, hits, castPosition);
}
示例5: BestQPosition
private Tuple<int, Vector3> BestQPosition(Obj_AI_Base target, List<Obj_AI_Base> targets, HitChance hitChance)
{
var castPos = Vector3.Zero;
var totalHits = 0;
try
{
var enemies = targets.Where(e => e.IsValidTarget(Q.Range * 1.5f)).ToList();
var enemyPositions = new List<Tuple<Obj_AI_Base, Vector3>>();
var circle = new Geometry.Polygon.Circle(Player.Position, Player.BoundingRadius, 30).Points;
foreach (var h in enemies)
{
var ePred = Q.GetPrediction(h);
if (ePred.Hitchance >= hitChance)
{
circle.Add(Player.Position.Extend(ePred.UnitPosition, Player.BoundingRadius).To2D());
enemyPositions.Add(new Tuple<Obj_AI_Base, Vector3>(h, ePred.UnitPosition));
}
}
var targetPos = target == null ? Vector3.Zero : target.Position;
if (target == null)
{
var possibilities =
ListExtensions.ProduceEnumeration(enemyPositions).Where(p => p.Count > 0).ToList();
var count = 0;
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility.Select(p => p.Item2.To2D()).ToList());
if (mec.Radius < Q.Width && possibility.Count > count)
{
count = possibility.Count;
targetPos = mec.Center.To3D();
}
}
}
if (targetPos.Equals(Vector3.Zero))
{
return new Tuple<int, Vector3>(totalHits, castPos);
}
circle = circle.OrderBy(c => c.Distance(targetPos)).ToList();
if (!enemyPositions.Any())
{
return new Tuple<int, Vector3>(totalHits, castPos);
}
foreach (var point in circle)
{
var hits = 0;
var containsTarget = false;
var direction = Q.Range * (point.To3D() - ObjectManager.Player.Position).Normalized().To2D();
var rect1 = new Geometry.Polygon.Rectangle(
Player.Position, Player.Position.Extend(Player.Position + direction.To3D(), Q.Range), Q.Width);
var rect2 = new Geometry.Polygon.Rectangle(
Player.Position,
Player.Position.Extend(Player.Position + direction.Rotated(QAngle).To3D(), Q.Range), Q.Width);
var rect3 = new Geometry.Polygon.Rectangle(
Player.Position,
Player.Position.Extend(Player.Position + direction.Rotated(-QAngle).To3D(), Q.Range), Q.Width);
foreach (var enemy in enemyPositions)
{
var bounding = new Geometry.Polygon.Circle(enemy.Item2, enemy.Item1.BoundingRadius * 0.85f);
if (bounding.Points.Any(p => rect1.IsInside(p) || rect2.IsInside(p) || rect3.IsInside(p)))
{
hits++;
if (target != null && enemy.Item1.NetworkId.Equals(target.NetworkId))
{
containsTarget = true;
}
}
}
if ((containsTarget || target == null) && hits > totalHits)
{
totalHits = hits;
castPos = Player.Position.Extend(point.To3D(), Q.Range);
if (totalHits >= enemies.Count)
{
break;
}
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, Vector3>(totalHits, castPos);
}
示例6: BestRFollowLocation
private Vector3 BestRFollowLocation(Vector3 position)
{
try
{
var center = Vector2.Zero;
float radius = -1;
var count = 0;
var moveDistance = -1f;
var maxRelocation = IsSpellUpgraded(R) ? R.Width * 1.2f : R.Width * 0.8f;
var targets = GameObjects.EnemyHeroes.Where(t => t.IsValidTarget(1500f)).ToList();
var circle = new Geometry.Polygon.Circle(position, R.Width);
if (targets.Any())
{
var minDistance = targets.Any(t => circle.IsInside(t)) ? targets.Min(t => t.BoundingRadius) * 2 : 0;
var possibilities =
ListExtensions.ProduceEnumeration(targets.Select(t => t.Position.To2D()).ToList())
.Where(p => p.Count > 1)
.ToList();
if (possibilities.Any())
{
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility);
var distance = position.Distance(mec.Center.To3D());
if (mec.Radius < R.Width && distance < maxRelocation && distance > minDistance)
{
if (possibility.Count > count ||
possibility.Count == count && (mec.Radius < radius || distance < moveDistance))
{
moveDistance = position.Distance(mec.Center.To3D());
center = mec.Center;
radius = mec.Radius;
count = possibility.Count;
}
}
}
if (!center.Equals(Vector2.Zero))
{
return center.To3D();
}
}
var dTarget = targets.OrderBy(t => t.Distance(position)).FirstOrDefault();
if (dTarget != null && position.Distance(dTarget.Position) > minDistance)
{
return dTarget.Position;
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return Vector3.Zero;
}
示例7: GetBestQLocation
private Tuple<int, Vector3> GetBestQLocation(Obj_AI_Hero target, HitChance hitChance)
{
try
{
if (target == null)
{
return new Tuple<int, Vector3>(0, Vector3.Zero);
}
var hits = new List<Obj_AI_Hero>();
var center = Vector3.Zero;
var radius = float.MaxValue;
var range = Q.Range + Q.Width + target.BoundingRadius * 0.85f;
var positions = (from t in GameObjects.EnemyHeroes
where t.IsValidTarget(range, true, Q.RangeCheckFrom)
let prediction = Q.GetPrediction(t)
where prediction.Hitchance >= (hitChance - 1)
select new CPrediction.Position(t, prediction.UnitPosition)).ToList();
if (positions.Any())
{
var mainTarget = positions.FirstOrDefault(p => p.Hero.NetworkId == target.NetworkId);
var possibilities =
ListExtensions.ProduceEnumeration(
positions.Where(p => p.UnitPosition.Distance(mainTarget.UnitPosition) <= Q.Width * 0.85f)
.ToList())
.Where(p => p.Count > 0 && p.Any(t => t.Hero.NetworkId == mainTarget.Hero.NetworkId))
.ToList();
var rReady = R.IsReady();
var wReady = W.IsReady();
foreach (var possibility in possibilities)
{
var mec = MEC.GetMec(possibility.Select(p => p.UnitPosition.To2D()).ToList());
var distance = Q.From.Distance(mec.Center.To3D());
if (distance < range)
{
if (mec.Radius < R.Width * 0.85f && possibility.Count >= 3 && rReady ||
mec.Radius < W.Width * 0.9f && possibility.Count >= 2 && wReady ||
mec.Radius < Q.Width * 0.9f && possibility.Count >= 1)
{
var lHits = new List<Obj_AI_Hero>();
var circle =
new Geometry.Polygon.Circle(
Q.From.Extend(mec.Center.To3D(), Q.Range > distance ? distance : Q.Range),
Q.Width);
lHits.AddRange(
(from position in positions
where
new Geometry.Polygon.Circle(
position.UnitPosition, (position.Hero.BoundingRadius * 0.85f)).Points
.Any(p => circle.IsInside(p))
select position.Hero));
if ((lHits.Count > hits.Count || lHits.Count == hits.Count && mec.Radius < radius ||
lHits.Count == hits.Count &&
Q.From.Distance(circle.Center.To3D()) < Q.From.Distance(center)) &&
lHits.Any(p => p.NetworkId == target.NetworkId))
{
center = circle.Center.To3D2();
radius = mec.Radius;
hits.Clear();
hits.AddRange(lHits);
}
}
}
}
if (!center.Equals(Vector3.Zero))
{
return new Tuple<int, Vector3>(hits.Count, center);
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, Vector3>(0, Vector3.Zero);
}
示例8: WPPolygon
private static Paths WPPolygon(Obj_AI_Hero Hero)
{
List<Vector2Time> HeroPath = Hero.GetWaypointsWithTime();
Vector2 myPath;
Paths WPPaths = new Paths();
for (var i = 0; i < HeroPath.Count() - 1; i++)
{
if (HeroPath.ElementAt<Vector2Time>(i + 1).Time <= 0.6f)
{
Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt<Vector2Time>(i).Position, HeroPath.ElementAt<Vector2Time>(i + 1).Position, Hero.BoundingRadius);
Geometry.Polygon.Circle Box = new Geometry.Polygon.Circle(HeroPath.ElementAt<Vector2Time>(i).Position, Hero.BoundingRadius);
WPPaths.Add(Box.ToClipperPath());
WPPaths.Add(WPRectangle.ToClipperPath());
}
else
{
myPath = PositionAfter(Hero, 0.6f, Hero.MoveSpeed);
Geometry.Polygon.Rectangle WPRectangle = new Geometry.Polygon.Rectangle(HeroPath.ElementAt<Vector2Time>(i).Position, myPath, Hero.BoundingRadius);
Geometry.Polygon.Circle Box = new Geometry.Polygon.Circle(myPath, Hero.BoundingRadius);
WPPaths.Add(Box.ToClipperPath());
WPPaths.Add(WPRectangle.ToClipperPath());
break;
}
}
Geometry.Polygon.Circle WPFirstBox = new Geometry.Polygon.Circle(HeroPath.First<Vector2Time>().Position, Hero.BoundingRadius);
WPPaths.Add(WPFirstBox.ToClipperPath());
return WPPaths;
}
示例9: ELogicFarm
private void ELogicFarm(List<Obj_AI_Base> targets, HitChance hitChance, int minHits)
{
try
{
var input = new PredictionInput
{
Range = ELength,
Delay = E.Delay,
Radius = E.Width,
Speed = E.Speed,
Type = E.Type
};
var input2 = new PredictionInput
{
Range = E.Range + ELength,
Delay = E.Delay,
Radius = E.Width,
Speed = E.Speed,
Type = E.Type
};
var startPos = Vector3.Zero;
var endPos = Vector3.Zero;
var hits = 0;
targets = targets.Where(t => t.IsValidTarget((E.Range + ELength + E.Width) * 1.1f)).ToList();
var targetCount = targets.Count;
foreach (var target in targets)
{
var lTarget = target;
if (target.ServerPosition.Distance(Player.ServerPosition) <= E.Range)
{
var cCastPos = target.ServerPosition;
foreach (var t in targets.Where(t => t.NetworkId != lTarget.NetworkId))
{
var count = 1;
input.Unit = t;
input.From = cCastPos;
input.RangeCheckFrom = cCastPos;
var pred = Prediction.GetPrediction(input);
var rect = new Geometry.Polygon.Rectangle(
cCastPos.To2D(), cCastPos.Extend(pred.CastPosition, ELength).To2D(), E.Width);
foreach (var c in targets.Where(c => c.NetworkId != lTarget.NetworkId))
{
input.Unit = c;
var cPredPos = c.Position;
if (
new Geometry.Polygon.Circle(
cPredPos, (c.IsMoving ? (c.BoundingRadius / 2f) : (c.BoundingRadius) * 0.9f))
.Points.Any(p => rect.IsInside(p)))
{
count++;
}
}
if (pred.Hitchance >= (hitChance - 1))
{
count++;
if (count > hits)
{
hits = count;
startPos = cCastPos;
endPos = cCastPos.Extend(pred.CastPosition, ELength);
if (hits == targetCount)
{
break;
}
}
}
}
if (endPos.Equals(Vector3.Zero))
{
startPos = cCastPos;
if (IsSpellUpgraded(E))
{
if (target.Path.Length > 0)
{
var newPos = target.Path[0];
if (target.Path.Length > 1 && newPos.Distance(target.ServerPosition) <= 150)
{
newPos = newPos.Extend(target.Path[1], 50);
}
startPos = target.ServerPosition.Extend(newPos, -(lTarget.BoundingRadius * 0.85f));
}
else if (target.IsFacing(Player))
{
startPos = target.ServerPosition.Extend(
Player.ServerPosition, -(lTarget.BoundingRadius * 0.85f));
}
else
{
startPos = cCastPos;
}
}
if (startPos.Distance(Player.ServerPosition) > E.Range)
{
startPos = Player.ServerPosition.Extend(startPos, E.Range);
}
if (target.Path.Length > 0)
{
endPos = startPos.Extend(target.Path[0], ELength);
}
//.........这里部分代码省略.........
示例10: Skillshot
public Skillshot(DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
DetectionType = detectionType;
SpellData = spellData;
StartTick = startT;
Start = start;
End = end;
Direction = (end - start).Normalized();
Unit = unit;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
Circle = new Geometry.Polygon.Circle(CollisionEnd, spellData.Radius, 22);
break;
case SkillShotType.SkillshotLine:
case SkillShotType.SkillshotMissileLine:
Rectangle = new Geometry.Polygon.Rectangle(Start, CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
Sector = new Geometry.Polygon.Sector(
start, CollisionEnd - start, spellData.Radius * (float) Math.PI / 180, spellData.Range, 22);
break;
case SkillShotType.SkillshotRing:
Ring = new Geometry.Polygon.Ring(CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
break;
}
UpdatePolygon();
}
示例11: Skillshot
public Skillshot(
DetectionType detectionType,
SpellData spellData,
int startT,
Vector2 start,
Vector2 end,
Obj_AI_Base unit)
{
this.DetectionType = detectionType;
this.SpellData = spellData;
this.StartTick = startT;
this.Start = start;
this.End = end;
this.Direction = (end - start).Normalized();
this.Unit = unit;
switch (spellData.Type)
{
case SkillShotType.SkillshotCircle:
this.Circle = new Geometry.Polygon.Circle(this.CollisionEnd, spellData.Radius, 22);
break;
case SkillShotType.SkillshotLine:
case SkillShotType.SkillshotMissileLine:
this.Rectangle = new Geometry.Polygon.Rectangle(this.Start, this.CollisionEnd, spellData.Radius);
break;
case SkillShotType.SkillshotCone:
this.Sector = new Geometry.Polygon.Sector(
start,
this.CollisionEnd - start,
spellData.Radius * (float)Math.PI / 180,
spellData.Range,
22);
break;
case SkillShotType.SkillshotRing:
this.Ring = new Geometry.Polygon.Ring(this.CollisionEnd, spellData.Radius, spellData.RingRadius, 22);
break;
case SkillShotType.SkillshotArc:
this.Arc = new Geometry.Polygon.Arc(
start,
end,
Configs.SkillShotsExtraRadius + (int)ObjectManager.Player.BoundingRadius,
22);
break;
}
this.UpdatePolygon();
}
示例12: GetHits
private Tuple<int, List<Obj_AI_Hero>> GetHits(Spell spell)
{
try
{
var hits = new List<Obj_AI_Hero>();
var positions = (from t in GameObjects.EnemyHeroes
where t.IsValidTarget(spell.Width * 4, true, spell.RangeCheckFrom)
let prediction = spell.GetPrediction(t)
where prediction.Hitchance >= HitChance.High
select new CPrediction.Position(t, prediction.UnitPosition)).ToList();
if (positions.Any())
{
var circle = new Geometry.Polygon.Circle(Ball.Position, spell.Width);
hits.AddRange(
from position in positions
where
!position.Hero.IsDashing() ||
(position.Hero.Distance(Ball.Position) >= 100f &&
position.Hero.Position.Distance(Ball.Position) >
position.Hero.GetDashInfo().EndPos.Distance(Ball.Position) - 50f)
where
new Geometry.Polygon.Circle(
position.UnitPosition,
(position.Hero.BoundingRadius * CPrediction.BoundingRadiusMultiplicator)).Points.Any(
p => circle.IsInside(p))
select position.Hero);
return new Tuple<int, List<Obj_AI_Hero>>(hits.Count, hits);
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<int, List<Obj_AI_Hero>>(0, null);
}
示例13: CastMec
private static void CastMec(Spell spell, int minHit)
{
if (!spell.IsReady() || ObjectManager.Player.HealthPercent <= 10)
return;
foreach (var target in HeroManager.Enemies.Where(x => x.IsValidTarget(spell.Range)))
{
var pred = spell.GetPrediction(target, true);
var nearByEnemies = 1;
if (spell.Type == SkillshotType.SkillshotLine && spell.Collision)
{
var poly = new Geometry.Polygon.Circle(pred.UnitPosition, spell.Width);
nearByEnemies +=
HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId)
.Count(enemy => poly.IsInside(enemy.ServerPosition));
}
else
{
nearByEnemies = pred.AoeTargetsHitCount;
}
if (nearByEnemies >= minHit)
{
spell.Cast(target);
return;
}
}
}
示例14: CastComboMec
private static void CastComboMec(Spell spell, int minHit)
{
if (!spell.IsReady() || !E.IsReady() || ObjectManager.Player.HealthPercent <= 10)
return;
const int gateDis = 200;
foreach (var target in ObjectManager.Get<Obj_AI_Hero>().Where(x => x.IsValidTarget(spell.Range)))
{
var tarPred = spell.GetPrediction(target, true);
Vector3 gateVector = ObjectManager.Player.Position + Vector3.Normalize(target.ServerPosition - ObjectManager.Player.Position)*gateDis;
var nearByEnemies = 1;
var poly = new Geometry.Polygon.Circle(tarPred.UnitPosition, spell.Width);
nearByEnemies += HeroManager.Enemies.Where(x => x.NetworkId != target.NetworkId).Count(enemy => poly.IsInside(enemy.ServerPosition));
if (ObjectManager.Player.Distance(tarPred.CastPosition) < spell.Range + 100 && nearByEnemies >= minHit)
{
if (Jayce.HammerTime && R.IsReady() && Jayce.CanQcd == 0 && Jayce.CanEcd == 0)
R.Cast();
else if(Jayce.HammerTime)
return;
Console.WriteLine("Hit Combo: " + nearByEnemies);
E.Cast(gateVector);
spell.Cast(tarPred.CastPosition);
return;
}
}
}
示例15: GetMaxRHits
private Tuple<List<Obj_AI_Hero>, Vector3> GetMaxRHits(HitChance hitChance, Vector3 fromCheck = default(Vector3))
{
if (fromCheck.Equals(default(Vector3)))
{
fromCheck = ObjectManager.Player.Position;
}
var input = new PredictionInput
{
Collision = true,
CollisionObjects = new[] { CollisionableObjects.YasuoWall },
From = fromCheck,
RangeCheckFrom = fromCheck,
Type = R.Type,
Radius = R.Width,
Delay = R.Delay,
Speed = R.Speed,
Range = R.Range,
Aoe = true
};
var castPosition = Vector3.Zero;
var totalHits = new List<Obj_AI_Hero>();
try
{
var positions = new List<CPrediction.Position>();
foreach (var t in GameObjects.EnemyHeroes)
{
if (t.IsValidTarget(R.Range * 1.5f, true, fromCheck))
{
input.Unit = t;
var prediction = Prediction.GetPrediction(input);
if (prediction.Hitchance >= hitChance)
{
positions.Add(new CPrediction.Position(t, prediction.UnitPosition));
}
}
}
var circle = new Geometry.Polygon.Circle(fromCheck, R.Range).Points;
foreach (var point in circle)
{
var hits = new List<Obj_AI_Hero>();
foreach (var position in positions)
{
R.UpdateSourcePosition(fromCheck, fromCheck);
if (R.WillHit(position.UnitPosition, point.To3D()))
{
hits.Add(position.Hero);
}
R.UpdateSourcePosition();
}
if (hits.Count > totalHits.Count)
{
castPosition = point.To3D();
totalHits = hits;
}
}
}
catch (Exception ex)
{
Global.Logger.AddItem(new LogItem(ex));
}
return new Tuple<List<Obj_AI_Hero>, Vector3>(totalHits, castPosition);
}