Britbot
void Britbot.SmartIsland.Update ( ) [inline]

updates the distances of all the enemies approaching the isalnds

Definition at line 313 of file SmartIsland.cs.

        {
            //---------------#Magic_Numbers--------------------
            //constant defining how far to look for enemy ships 
            //int DangerZone = 6 * Bot.Game.GetAttackRadius();

            //---------------#Magic_Numbers--------------------
            /*const int HowLongToLookBack = 1;
            //add new data
            this.SurroundingForces.Enqueue(this.NearbyEnemyCount(Magic.DangerZone));

            //trim the end of the queue if needed
            if (this.SurroundingForces.Count > HowLongToLookBack)
            {
                this.SurroundingForces.Dequeue();
            }*/

            //update enemy distances
            this.approachingEnemies.Clear();
            foreach (EnemyGroup eGroup in Enemy.Groups)
            {
            //    if(eGroup.MinimalETATo(this.Loc) < Magic.MaxEnemyPredictionDistnace)
                    this.approachingEnemies.Add(new KeyValuePair<EnemyGroup, bool>(eGroup, eGroup.IsApproachingIsland(this)));
            }
            //sort the list by distance
            this.approachingEnemies.Sort(
                (e1, e2) => e1.Key.MinimalETATo(this.Loc).CompareTo(e2.Key.MinimalSquaredDistanceTo(this.Loc)));
        }