Beispiel #1
0
        private static FarmLocation GetCircularFarmLocation(Obj_AI_Base[] units, Spell spell)
        {
            if (!units.Any() || units == null)
            {
                return new FarmLocation
                {
                    MinionsHit = 0,
                    Position = new Vector3()
                };
            }

            var farmlocation =
                Prediction.Position.PredictCircularMissileAoe(units, spell.Range, spell.Width, spell.Delay, spell.Speed)
                    .OrderBy(h => h.CollisionObjects.Count(x => x.IsMinion)).FirstOrDefault();

            return new FarmLocation
            {
                MinionsHit = farmlocation.CollisionObjects.Count(h => h.IsMinion),
                Position = farmlocation.CastPosition
            };
        }