Ejemplo n.º 1
0
        public string GetBackupFolderTitle()
        {
            var townName  = Players[0].Personal.TownName;
            var timestamp = Main.LastSaved.TimeStamp.Replace(':', '.');

            return(StringUtil.CleanFileName($"{townName} - {timestamp}"));
        }
Ejemplo n.º 2
0
        private static void Dump(this DesignPatternPRO dp, string path)
        {
            var name = dp.DesignName;
            var fn   = StringUtil.CleanFileName($"{name}.nhpd");
            var dest = Path.Combine(path, fn);

            File.WriteAllBytes(dest, dp.Data);
        }
Ejemplo n.º 3
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.º 4
0
        private static void Dump(this DesignPatternPRO dp, string path, int index, bool indexed)
        {
            var    name = dp.DesignName;
            string fn   = indexed
                ? $"{index:00} - {name}.nhd"
                : $"{name}.nhd";

            fn = StringUtil.CleanFileName(fn);
            var dest = Path.Combine(path, fn);

            File.WriteAllBytes(dest, dp.Data);
        }
Ejemplo n.º 5
0
        private static void Dump(this DesignPatternPRO dp, string path, int index)
        {
            // Dump without index
            var name = dp.DesignName;
            var fn   = StringUtil.CleanFileName($"{name}.nhpd");
            var dest = Path.Combine(path, fn);

            File.WriteAllBytes(dest, dp.Data);

            // Dump with index
            fn   = StringUtil.CleanFileName($"{index:00} - {name}.nhpd");
            dest = Path.Combine(path, fn);
            File.WriteAllBytes(dest, dp.Data);
        }