예제 #1
0
 public void ParseTemplateGroupXml(XElement xml)
 {
     Name           = TmxHelper.GetAttributeAsString(xml, "name");
     NextTemplateId = TmxHelper.GetAttributeAsUInt(xml, "nexttemplateid");
     TemplateMap    = ParentMap.MakeTemplate(Name);
     foreach (XElement item in xml.Descendants("tileset"))
     {
         TsxTileset.FromXml(item, TemplateMap);
     }
     foreach (XElement item2 in xml.Descendants("template"))
     {
         TgxTemplate tgxTemplate = TgxTemplate.FromXml(item2, FirstTemplateId, TemplateMap);
         if (tgxTemplate != null)
         {
             Templates.Add(tgxTemplate);
         }
     }
 }
예제 #2
0
 private void ParseAllTilesets(XDocument doc)
 {
     Logger.WriteVerbose("Parsing tileset elements ...");
     foreach (XElement item in from item in doc.Descendants("tileset")
              select(item))
     {
         TsxTileset tsxTileset = TsxTileset.FromXml(item, this);
         if (tsxTileset != null)
         {
             Tilesets.Add(tsxTileset);
         }
     }
     foreach (XElement item2 in from item in doc.Descendants("imagelayer")
              select(item))
     {
         TsxTileset tsxTileset2 = TsxTileset.FromImageLayerXml(item2, this);
         if (tsxTileset2 != null)
         {
             Tilesets.Add(tsxTileset2);
         }
     }
 }