private AbstractTile ParseTileNode(XmlNode tileNode, LevelSet project, Dictionary <int, object> objectIdDictionary)
        {
            SimpleTile2DTransitionObject tile = new SimpleTile2DTransitionObject();

            tile.Name = tileNode.Attributes["name"].Value;
            int id     = Convert.ToInt32(tileNode.Attributes["id"].Value);
            int height = Convert.ToInt32(tileNode.Attributes["height"].Value);
            int width  = Convert.ToInt32(tileNode.Attributes["width"].Value);

            objectIdDictionary[id] = tile;

            Texture2DContent textureContent = new Texture2DContent();

            foreach (XmlNode childNode in tileNode.ChildNodes)
            {
                if (childNode.Name == "contents")
                {
                    byte[] binaryData = Convert.FromBase64String(childNode.InnerText);

                    PixelBitmapContent <Color> rawData = new PixelBitmapContent <Color>(width, height);
                    rawData.SetPixelData(binaryData);
                    textureContent.Mipmaps = new MipmapChain(rawData);
                }
            }

            tile.TextureContent = textureContent;

            return(tile);
        }
        protected override void Write(ContentWriter output, TWrite value)
        {
            output.Write(value.Tiles.Count);

            foreach (AbstractTile tile in value.Tiles)
            {
                output.Write(tile.Id);
                output.Write(tile.Name);

                if (tile is SimpleTile2DTransitionObject)
                {
                    SimpleTile2DTransitionObject simpleTile2D = (SimpleTile2DTransitionObject)tile;
                    output.WriteObject <Texture2DContent>(simpleTile2D.TextureContent);
                }
            }

            output.Write(value.Levels.Count);

            foreach (AbstractLevelDefinition level in value.Levels)
            {
                if (level is LevelDefinition)
                {
                    LevelDefinition simpleGrid2DLevel = (LevelDefinition)level;

                    output.Write(simpleGrid2DLevel.Name);
                    output.Write(simpleGrid2DLevel.Rows);
                    output.Write(simpleGrid2DLevel.Columns);
                    output.Write(simpleGrid2DLevel.CellSize);
                    output.Write(simpleGrid2DLevel.BackColor);

                    for (int row = 0; row < simpleGrid2DLevel.Rows; row++)
                    {
                        for (int column = 0; column < simpleGrid2DLevel.Columns; column++)
                        {
                            output.Write(simpleGrid2DLevel.GetTileId(row, column));
                        }
                    }
                }
            }
        }