internal static void Write(ContentWriter writer, LayerSettingsContent content)
 {
     if (content is GridLayerSettingsContent)
     {
         GridLayerSettingsContent gContent = content as GridLayerSettingsContent;
         writer.Write("g");
         writer.Write(gContent.GridColor);
         writer.Write(gContent.GridDrawSize);
         writer.Write(gContent.GridSize);
         writer.Write(gContent.Name);
         writer.Write(gContent.ExportAsObjects);
         writer.Write(gContent.NewLine);
     }
     else if (content is ObjectLayerSettingsContent)
     {
         ObjectLayerSettingsContent oContent = content as ObjectLayerSettingsContent;
         writer.Write("o");
         writer.Write(oContent.GridColor);
         writer.Write(oContent.GridDrawSize);
         writer.Write(oContent.GridSize);
         writer.Write(oContent.Name);
     }
     else if (content is TileLayerSettingsContent)
     {
         TileLayerSettingsContent tContent = content as TileLayerSettingsContent;
         writer.Write("t");
         writer.Write(tContent.GridColor);
         writer.Write(tContent.GridDrawSize);
         writer.Write(tContent.GridSize);
         writer.Write(tContent.Name);
         writer.Write(tContent.ExportTileIDs);
         writer.Write(tContent.ExportTileSize);
         writer.Write(tContent.MultipleTilesets);
     }
 }
 internal static LayerSettingsContent Parse(XmlNode node)
 {
     LayerSettingsContent content = null;
     switch (node.Name)
     {
         case "grid":
             content = new GridLayerSettingsContent(node);
             break;
         case "tiles":
             content = new TileLayerSettingsContent(node);
             break;
         case "objects":
             content = new ObjectLayerSettingsContent(node);
             break;
     }
     return content;
 }
示例#3
0
        internal static LayerSettingsContent Read(XmlNode node)
        {
            LayerSettingsContent content = null;

            switch (node.Name)
            {
            case "grid":
                content = new GridLayerSettingsContent(node);
                break;

            case "tiles":
                content = new TileLayerSettingsContent(node);
                break;

            case "objects":
                content = new ObjectLayerSettingsContent(node);
                break;
            }
            return(content);
        }