forked from danarcher/XCom2ModTool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSaveGame.cs
100 lines (83 loc) · 3.48 KB
/
SaveGame.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
using System;
using Newtonsoft.Json;
using XCom2ModTool.UnrealPackages;
namespace XCom2ModTool
{
internal class SaveGame
{
public static readonly int MinSupportedVersion = 20;
public static readonly int MaxSupportedVersion = 22;
public uint Version { get; set; }
[JsonConverter(typeof(HexJsonConverter)), JsonProperty("$HeaderSizeCheck")]
public uint HeaderSizeCheck { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Checksum { get; set; }
[JsonConverter(typeof(HexJsonConverter)), JsonProperty("$ChecksumCheck")]
public uint ChecksumCheck { get; set; }
public uint UncompressedSize { get; set; }
public uint CampaignNumber { get; set; }
public uint SaveSlotNumber { get; set; }
public ParsedDescription Description { get; set; }
public DateTime? SaveDateTime { get; set; }
public string MapCommand { get; set; }
public bool Tactical { get; set; }
public bool Ironman { get; set; }
public bool AutoSave { get; set; }
public bool QuickSave { get; set; }
public string Language { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown6 { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown7 { get; set; }
public uint ArchiveFileVersion { get; set; }
public uint ArchiveLicenseeVersion { get; set; }
public string CampaignStartDateTime { get; set; }
public string MissionImageUri { get; set; }
public string PlayerSaveName { get; set; }
public string[] DLCPackNames { get; set; }
public string[] DLCPackFriendlyNames { get; set; }
public uint Mission { get; set; }
public uint Month { get; set; }
public uint Turn { get; set; }
public uint Action { get; set; }
public string MissionType { get; set; }
public bool DebugSave { get; set; }
public bool PreMission { get; set; }
public bool PostMission { get; set; }
public bool Ladder { get; set; }
[JsonIgnore]
public CompressedChunk[] Chunks { get; set; }
[JsonIgnore]
public byte[] AllChunksData { get; set; }
[JsonIgnore]
public ParsedNameTable NameTable { get; set; }
public string ToJson() => JsonConvert.SerializeObject(this, Formatting.Indented);
public class ParsedDescription
{
public DateTime? SaveDateTime { get; set; }
public string SaveName { get; set; }
public string MissionTypeName { get; set; }
public string OperationName { get; set; }
public DateTime? GameDateTime { get; set; }
public string MapName { get; set; }
}
public class ParsedNameTable
{
public uint Version { get; set; }
public uint LicenseeVersion { get; set; }
public ParsedNameEntry[] Names { get; set; }
}
public class ParsedNameEntry
{
public string Name { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown1 { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown2 { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown3 { get; set; }
[JsonConverter(typeof(HexJsonConverter))]
public uint Unknown4 { get; set; }
}
}
}