Beispiel #1
0
 public static void SerializeToFile(string fileName, ExportedBattle battle)
 {
     // Save the version for local editing.
     Directory.CreateDirectory(UiHelper.GetParentFolder(fileName));
     using (var writer = new StreamWriter(fileName))
     {
         var serial = new JsonSerializer();
         serial.Formatting = Newtonsoft.Json.Formatting.Indented;
         serial.Serialize(writer, battle);
     }
 }
Beispiel #2
0
 public static string ToDefaultBattleExportFolder(string filename)
 {
     return(UiHelper.GetParentFolder(filename));
 }