public List<Unit> getUnitsInRange(GameObjects.Target t, float range, bool isAlive = false) { var units = new List<Unit>(); foreach (var kv in objects) { var u = kv.Value as Unit; if (u != null && t.distanceWith(u) <= range) if (isAlive && !u.isDead() || !isAlive) units.Add(u); } return units; }
public List<Champion> getChampionsInRange(GameObjects.Target t, float range, bool isAlive = false) { var champs = new List<Champion>(); foreach (var kv in champions) { var c = kv.Value; if (t.distanceWith(c) <= range) if (isAlive && !c.isDead() || !isAlive) //TODO: check champs.Add(c); } return champs; }