public void Write(string filename) { FileStream fs = new FileStream(filename, FileMode.Create); TextWriter tw = new StreamWriter(fs); LispWriter writer = new LispWriter(tw); writer.WriteComment("Generated by tiler"); writer.StartList("supertux-tiles"); foreach (TileGroup tilegroup in TileGroups) { tilegroup.Write(writer); } foreach (Tile tile in Tiles) { if (tile == null) { continue; } if (tile.ID >= 0) { tile.Write(writer); } } writer.EndList("supertux-tiles"); tw.Close(); fs.Close(); }
public void Write(string filename) { FileStream fs = new FileStream(filename, FileMode.Create); TextWriter tw = new StreamWriter(fs); LispWriter writer = new LispWriter(tw); writer.WriteComment("Created with Cobble"); writer.StartList("supertux-level"); writer.Write("version", this.version); writer.StartList("name"); writer.Write("_", this.name); writer.EndList("name"); writer.Write("author", this.author); foreach (Sector sector in this.sectors) { sector.Write(writer); } writer.EndList("supertux-level"); tw.Close(); fs.Close(); }
public void Write(string filename) { FileStream fs = new FileStream(filename, FileMode.Create); TextWriter tw = new StreamWriter(fs); LispWriter writer = new LispWriter(tw); writer.WriteComment("Generated by tiler"); writer.StartList("supertux-tiles"); foreach(TileGroup tilegroup in TileGroups) { tilegroup.Write(writer); } foreach(Tile tile in Tiles) { if(tile == null) continue; if(tile.ID >= 0) tile.Write(writer); } writer.EndList("supertux-tiles"); tw.Close(); fs.Close(); }