Пример #1
0
        public static void Save(Map map)
        {
            SharpTag ret = new SharpTag()
            {
                { "mapname", map.Name },
                { "mapwidth", map.Width },
                { "mapheight", map.Height }
            };

            if (map.Tiles == null)
            {
                map.Tiles = new Sprite[map.Width, map.Height];
            }

            for (int i = 0; i < map.Width; i++)
            {
                for (int j = 0; j < map.Height; j++)
                {
                    ret.Add($"maptile[{i},{j}]", map.Tiles[i, j].Save());
                }
            }

            BitIO.ToFile(ret, Path.Combine("Maps", map.Name), false);
        }
Пример #2
0
 protected override void UnloadContent()
 {
     RootTag.Add("SETTINGS", Settings.Save());
     BitIO.ToFile(RootTag, "ff.dat", false);
     MediaCache.UnloadAll();
 }