public virtual bool AcceptOverride(HeatMovementRequestEvent ev)
 {
     this.ImplementStrategy(
         i => new HeatedAntMovementStrategy(i.Ant, i.DefaultPreviousMovementStrategy, ev.Route));
     return true;
 }
        private void MoveAntsToColdestRegions(List<MapTile> coldestTiles)
        {
            var antsDispatched = new Dictionary<Ant, MapRoute>();
            int mapArea = GameContext.Map.Columns*GameContext.Map.Rows;
            var mapGlobeRadius = (int)Math.Floor(Math.Sqrt(mapArea/Math.PI));
            int maxRangeToSearch = Math.Min(GameContext.ViewRadius*3/2, mapGlobeRadius);

            Action resortTiles = () => coldestTiles.Sort((x, y) => x.HeatIndex.CompareTo(y.HeatIndex));

            resortTiles();

            for (int index = 0; index < coldestTiles.Count; index++)
            {
                MapTile tileUnderConsideration = coldestTiles[index];
                int max = 0;

                do
                {
                    int min = max;
                    max = min + GameContext.ViewRadius/2;

                    IEnumerable<MapRoute> routes = this.FindAllAntsWithinRange(tileUnderConsideration, antsDispatched,
                                                                               min, max);
                    bool wasAntsDispatched = false;

                    foreach (MapRoute route in routes)
                    {
                        // we would like to extend our range. So there is nothing left in the loop for us
                        // to process
                        if (route == null)
                            continue;

                        AntMovementStrategy strategy = route.Source.CurrentAnt.MovementStrategy;
                        var heatMoveRequest = new HeatMovementRequestEvent(route);

                        // first check if the strategy is accept the override.
                        if (!strategy.AcceptOverride(heatMoveRequest))
                            continue;

                        ApplyGaussian(this._promiseToVisit, new[] {tileUnderConsideration});
                        antsDispatched.Add(route.Source.CurrentAnt, route);
                        wasAntsDispatched = true;
                    }

                    if (!wasAntsDispatched)
                        continue;

                    index--;
                    resortTiles();
                    break;
                } while (max < maxRangeToSearch);
            }
        }