Ejemplo n.º 1
0
        public static void ImportDesignTiles(MainSave sav, byte[] result)
        {
            var tiles = sav.GetMapDesignTiles();

            Buffer.BlockCopy(result, 0, tiles, 0, result.Length);
            sav.SetMapDesignTiles(tiles);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Dumps all designs to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 public static void DumpDesignsPRO(this MainSave sav, string path)
 {
     for (int i = 0; i < MainSaveOffsets.PatternCount; i++)
     {
         sav.GetDesignPRO(i).Dump(path);
     }
 }
Ejemplo n.º 3
0
 public MapTerrainStructure(MainSave sav)
 {
     Terrain   = new TerrainLayer(sav.GetTerrainTiles(), sav.GetAcreBytes());
     Buildings = sav.Buildings;
     PlazaX    = sav.EventPlazaLeftUpX;
     PlazaY    = sav.EventPlazaLeftUpZ;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Dumps all designs to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 public static void DumpDesignsPRO(this MainSave sav, string path)
 {
     for (int i = 0; i < sav.Offsets.PatternCount; i++)
     {
         var dp = sav.GetDesignPRO(i);
         dp.Dump(path, i);
     }
 }
Ejemplo n.º 5
0
        public static byte[] ExportDesignTiles(MainSave sav)
        {
            var tiles  = sav.GetMapDesignTiles();
            var result = new byte[tiles.Length * 2];

            Buffer.BlockCopy(tiles, 0, result, 0, result.Length);
            return(result);
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Dumps all designs to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 /// <param name="indexed">Export file names prepended with design index</param>
 public static void DumpDesigns(this MainSave sav, string path, bool indexed)
 {
     for (int i = 0; i < sav.Offsets.PatternCount; i++)
     {
         var dp = sav.GetDesign(i);
         dp.Dump(path, i, indexed);
     }
 }
Ejemplo n.º 7
0
 /// <summary>
 /// Dumps all villager houses to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 public static void DumpVillagerHouses(this MainSave sav, string path)
 {
     for (int i = 0; i < MainSaveOffsets.VillagerCount; i++)
     {
         var v = sav.GetVillager(i);
         var h = sav.GetVillagerHouse(i);
         h.Dump(path, v);
     }
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Dumps all villagers in their decrypted state to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 public static void DumpVillagers(this MainSave sav, string path)
 {
     for (int i = 0; i < 10; i++)
     {
         var v    = sav.GetVillager(i);
         var name = GameInfo.Strings.GetVillager(v.InternalName);
         var dest = Path.Combine(path, $"{name}.nhv");
         File.WriteAllBytes(dest, v.Data);
     }
 }
Ejemplo n.º 9
0
        public static void ClearDesignTiles(MainSave sav)
        {
            var tiles = sav.GetMapDesignTiles();

            for (int i = 0; i < tiles.Length; i++)
            {
                tiles[i] = MainSave.MapDesignNone;
            }
            sav.SetMapDesignTiles(tiles);
        }
Ejemplo n.º 10
0
 /// <summary>
 /// Dumps all designs to the requested <see cref="path"/>.
 /// </summary>
 /// <param name="sav">Save Data to dump from</param>
 /// <param name="path">Path to dump to</param>
 public static void DumpDesigns(this MainSave sav, string path)
 {
     for (int i = 0; i < 50; i++)
     {
         var dp   = sav.GetDesign(i);
         var name = dp.DesignName;
         var fn   = StringUtil.CleanFileName($"{name}.nhd");
         var dest = Path.Combine(path, fn);
         File.WriteAllBytes(dest, dp.Data);
     }
 }
Ejemplo n.º 11
0
 public HorizonSave(string folder)
 {
     Main    = new MainSave(folder);
     Players = Player.ReadMany(folder);
 }
Ejemplo n.º 12
0
        }                                 // 0 or 1

        public MapManager(MainSave sav) : base(sav)
        {
            Items = new FieldItemManager(sav);
        }
Ejemplo n.º 13
0
 public FieldItemManager(MainSave sav)
 {
     Layer1 = new FieldItemLayer(sav.GetFieldItemLayer1());
     Layer2 = new FieldItemLayer(sav.GetFieldItemLayer2());
     SAV    = sav;
 }