Ejemplo n.º 1
0
        private void DrawZones()
        {
            var board = App.AnthillModel.CurrentWorld.Board;

            for (var i = 0; i < board.Size; ++i)
            {
                for (var j = 0; j < board.Size; ++j)
                {
                    var location = new Location(i, j);
                    var zone     = board.Get(location);

                    Image texture;

                    if (zone.Name == "Ground")
                    {
                        var ground = (Ground)zone;

                        if (ground.Pheromones.Count > 0 && ground.Pheromones.Count <= 10)
                        {
                            texture = WindowUtils.FindImage("light_pheromone");
                        }
                        else if (ground.Pheromones.Count > 10)
                        {
                            texture = WindowUtils.FindImage("heavy_pheromone");
                        }
                        else
                        {
                            continue;
                        }
                    }
                    else
                    {
                        texture = WindowUtils.FindZoneImage(zone);
                    }

                    Board.Children.Add(texture);
                    Grid.SetColumn(texture, location.Latitude);
                    Grid.SetRow(texture, location.Longitude);
                }
            }
        }