コード例 #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);
        }
コード例 #2
0
 public void RemoveAllyFromList(Ally script)
 {
     allies.Remove(script);
 }
コード例 #3
0
 public void AddAllyToList(Ally script)
 {
     allies.Add(script);
 }