Пример #1
0
    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();
    }
Пример #2
0
        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();
        }
Пример #3
0
    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();
    }
Пример #4
0
        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();
        }