private List <int> BestMove() { int lowestHp = 5; Ally target = null; IEnumerable <Ally> enemies = CheckEnemiesInRange(range * 2 + 1); foreach (var enemy in enemies.Where(enemy => enemy.hp <= lowestHp)) { lowestHp = enemy.hp; target = enemy; } if (target != null) { return(FindMove(target.pos)); } return(null); }
public void RemoveAllyFromList(Ally script) { allies.Remove(script); }
public void AddAllyToList(Ally script) { allies.Add(script); }