public override void LoadContent()
        {
            this._font = this.GameManager.Game.Content.Load <SpriteFont>(@"Fonts\GameFont");

            this._engineIdle = this.GameManager.Game.Content.Load <SoundEffect>(@"Sounds\Engine").CreateInstance();
            this._carScreech = this.GameManager.Game.Content.Load <SoundEffect>(@"Sounds\pop").CreateInstance();
            this._carHorn    = this.GameManager.Game.Content.Load <SoundEffect>(@"Sounds\Horn").CreateInstance();

            this.Logo       = this.GameManager.Game.Content.Load <Texture2D>(@"Textures\racer");
            this._car       = this.GameManager.Game.Content.Load <Texture2D>(@"Textures\car");
            this._raceFlags = this.GameManager.Game.Content.Load <Texture2D>(@"Textures\racerflags");

            _textureMap.Add(TilePiece.Grass, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\grass"));
            _textureMap.Add(TilePiece.TopLeft, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\tl"));
            _textureMap.Add(TilePiece.TopRight, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\tr"));
            _textureMap.Add(TilePiece.BottomLeft, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\bl"));
            _textureMap.Add(TilePiece.BottomRight, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\br"));
            _textureMap.Add(TilePiece.Horizontal, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\h"));
            _textureMap.Add(TilePiece.Vertical, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\v"));
            _textureMap.Add(TilePiece.Start, this.GameManager.Game.Content.Load <Texture2D>(@"Textures\tl"));


            this.Assets.Add(_engineIdle);
            this.Assets.Add(_carScreech);
            this.Assets.Add(_carHorn);
            this.Assets.Add(Logo);
            this.Assets.Add(_car);
            this.Assets.Add(_raceFlags);

            foreach (IDisposable asset in _textureMap.Values)
            {
                this.Assets.Add(asset);
            }

            this._engineIdle.Volume   = this._carScreech.Volume = this._carHorn.Volume = 0.5f;
            this._engineIdle.IsLooped = true;


            _mapPanel.Bounds = new Rectangle(0, 0, 800, 480);

            int mapCount = 0;
            HorizontalStackPanel panel = null;

            foreach (string mapName in MapNames)
            {
                string mapData = this.GameManager.Game.Content.Load <string>(@"RacerMaps\" + mapName).Trim();
                LoadedMaps.Add(mapName, mapData);

                if (null == panel)
                {
                    panel = new HorizontalStackPanel();
                    panel.VerticalAlignment = VerticalAlignment.Middle;
                    panel.FixedSize         = false;
                    panel.Bounds            = new Rectangle(0, 0, 800, 180);

                    _mapPanel.AddChild(panel);
                }

                VerticalStackPanel vertPanel = new VerticalStackPanel();
                vertPanel.Bounds = new Rectangle(0, 0, 200, 150);

                XnaRaceTrackTile tile = new XnaRaceTrackTile(_textureMap, mapName, mapData);
                tile.Tag    = tile;
                tile.Bounds = new Rectangle(0, 0, 200, 120);
                tile.Click += new EventHandler(mapTile_Click);

                XnaButton button = new XnaButton(new Rectangle(0, 0, 250, 30));
                button.Tag      = tile;
                button.Text     = mapName;
                button.FontZoom = 0.5f;
                button.Click   += new EventHandler(mapTile_Click);

                if (FingerGames.IsTrial && mapCount > 2)
                {
                    button.Color = new Color(110, 110, 110);
                }

                vertPanel.AddChild(tile);
                vertPanel.AddChild(button);

                panel.AddChild(vertPanel);

                mapCount++;

                if ((mapCount % 3) == 0)
                {
                    panel = null;
                }
            }
            _mapPanel.ForceLayout();

            float maxX = 0;

            for (int i = 0; i < 10; ++i)
            {
                maxX = Math.Max(maxX, _font.MeasureString(i.ToString()).X);
            }

            _decimalWidth = maxX * 1.05f / 2;

            this._timePanel.Bounds    = new Rectangle(0, 10, 800, 470);
            this._timePanel.FixedSize = true;

            XnaImage flagsImage     = new XnaImage(this._raceFlags, new Rectangle(0, 0, this._raceFlags.Width, this._raceFlags.Height));
            XnaLabel completedLabel = new XnaLabel(new Rectangle(0, 0, 800, 90));

            completedLabel.BackColor = new Color(0, 0, 0, 150);
            completedLabel.FontZoom  = 1.5f;
            completedLabel.Text      = "Race Completed!";

            this._timePanel.AddChild(flagsImage);
            this._timePanel.AddChild(completedLabel);
            this._timePanel.AddChild(_timeLabel);

            base.LoadContent();
        }
        public override void LoadContent()
        {
            this._font = this.GameManager.Game.Content.Load<SpriteFont>(@"Fonts\GameFont");

            this._engineIdle = this.GameManager.Game.Content.Load<SoundEffect>(@"Sounds\Engine").CreateInstance();
            this._carScreech = this.GameManager.Game.Content.Load<SoundEffect>(@"Sounds\pop").CreateInstance();
            this._carHorn = this.GameManager.Game.Content.Load<SoundEffect>(@"Sounds\Horn").CreateInstance();

            this.Logo = this.GameManager.Game.Content.Load<Texture2D>(@"Textures\racer");
            this._car = this.GameManager.Game.Content.Load<Texture2D>(@"Textures\car");
            this._raceFlags = this.GameManager.Game.Content.Load<Texture2D>(@"Textures\racerflags");

            _textureMap.Add(TilePiece.Grass, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\grass"));
            _textureMap.Add(TilePiece.TopLeft, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\tl"));
            _textureMap.Add(TilePiece.TopRight, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\tr"));
            _textureMap.Add(TilePiece.BottomLeft, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\bl"));
            _textureMap.Add(TilePiece.BottomRight, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\br"));
            _textureMap.Add(TilePiece.Horizontal, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\h"));
            _textureMap.Add(TilePiece.Vertical, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\v"));
            _textureMap.Add(TilePiece.Start, this.GameManager.Game.Content.Load<Texture2D>(@"Textures\tl"));

            this.Assets.Add(_engineIdle);
            this.Assets.Add(_carScreech);
            this.Assets.Add(_carHorn);
            this.Assets.Add(Logo);
            this.Assets.Add(_car);
            this.Assets.Add(_raceFlags);

            foreach (IDisposable asset in _textureMap.Values)
            {
                this.Assets.Add(asset);
            }

            this._engineIdle.Volume = this._carScreech.Volume = this._carHorn.Volume = 0.5f;
            this._engineIdle.IsLooped = true;

            _mapPanel.Bounds = new Rectangle(0, 0, 800, 480);

            int mapCount = 0;
            HorizontalStackPanel panel = null;

            foreach (string mapName in MapNames)
            {
                string mapData = this.GameManager.Game.Content.Load<string>(@"RacerMaps\" + mapName).Trim();
                LoadedMaps.Add(mapName, mapData);

                if (null == panel)
                {
                    panel = new HorizontalStackPanel();
                    panel.VerticalAlignment = VerticalAlignment.Middle;
                    panel.FixedSize = false;
                    panel.Bounds = new Rectangle(0, 0, 800, 180);

                    _mapPanel.AddChild(panel);
                }

                VerticalStackPanel vertPanel = new VerticalStackPanel();
                vertPanel.Bounds = new Rectangle(0, 0, 200, 150);

                XnaRaceTrackTile tile = new XnaRaceTrackTile(_textureMap, mapName, mapData);
                tile.Tag = tile;
                tile.Bounds = new Rectangle(0, 0, 200, 120);
                tile.Click += new EventHandler(mapTile_Click);

                XnaButton button = new XnaButton(new Rectangle(0, 0, 250, 30));
                button.Tag = tile;
                button.Text = mapName;
                button.FontZoom = 0.5f;
                button.Click += new EventHandler(mapTile_Click);

                if (FingerGames.IsTrial && mapCount > 2)
                {
                    button.Color = new Color(110, 110, 110);
                }

                vertPanel.AddChild(tile);
                vertPanel.AddChild(button);

                panel.AddChild(vertPanel);

                mapCount++;

                if ((mapCount % 3) == 0)
                {
                    panel = null;
                }
            }
            _mapPanel.ForceLayout();

            float maxX = 0;
            for (int i = 0; i < 10; ++i)
            {
                maxX = Math.Max(maxX, _font.MeasureString(i.ToString()).X);
            }

            _decimalWidth = maxX * 1.05f / 2;

            this._timePanel.Bounds = new Rectangle(0, 10, 800, 470);
            this._timePanel.FixedSize = true;

            XnaImage flagsImage = new XnaImage(this._raceFlags, new Rectangle(0, 0, this._raceFlags.Width, this._raceFlags.Height));
            XnaLabel completedLabel = new XnaLabel(new Rectangle(0, 0, 800, 90));
            completedLabel.BackColor = new Color(0, 0, 0, 150);
            completedLabel.FontZoom = 1.5f;
            completedLabel.Text = "Race Completed!";

            this._timePanel.AddChild(flagsImage);
            this._timePanel.AddChild(completedLabel);
            this._timePanel.AddChild(_timeLabel);

            base.LoadContent();
        }