Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 public void RemoveAllyFromList(Ally script)
 {
     allies.Remove(script);
 }
Esempio n. 3
0
 public void AddAllyToList(Ally script)
 {
     allies.Add(script);
 }