diff --git a/EDPlayerJournal/Entries/FileHeaderEntry.cs b/EDPlayerJournal/Entries/FileHeaderEntry.cs index 2ce393c..6bef523 100644 --- a/EDPlayerJournal/Entries/FileHeaderEntry.cs +++ b/EDPlayerJournal/Entries/FileHeaderEntry.cs @@ -26,6 +26,22 @@ public class FileHeaderEntry : Entry { /// public string? Build { get; set; } + /// + /// Returns true if the version is legacy (3.X) + /// + public bool IsLegacy { + get { + return GameVersion.StartsWith("3."); + } + } + + /// + /// Returns true if the version is live (4.x) + /// + public bool IsLive { + get { return !IsLegacy; } + } + protected override void Initialise() { Part = JSON.Value("part") ?? 1; Language = JSON.Value("language") ?? string.Empty; diff --git a/EDPlayerJournalTests/FileHeaderTest.cs b/EDPlayerJournalTests/FileHeaderTest.cs index 93d1669..1479c14 100644 --- a/EDPlayerJournalTests/FileHeaderTest.cs +++ b/EDPlayerJournalTests/FileHeaderTest.cs @@ -21,6 +21,8 @@ public class FileHeaderTest { Assert.AreEqual(header.Language, "English/UK"); Assert.AreEqual(header.Odyssey, true); Assert.AreEqual(header.GameVersion, "4.0.0.1450"); + Assert.AreEqual(header.IsLegacy, false); + Assert.AreEqual(header.IsLive, true); // Someone at FDev messed up string building there. Assert.AreEqual(header.Build, "r286858/r0 "); } @@ -44,6 +46,8 @@ public class FileHeaderTest { Assert.AreEqual(header.Language, """English\UK"""); Assert.AreEqual(header.Odyssey, false); Assert.AreEqual(header.GameVersion, "3.5.3.400 EDH"); + Assert.AreEqual(header.IsLegacy, true); + Assert.AreEqual(header.IsLive, false); // ~73k commits in two years. Not bad. Assert.AreEqual(header.Build, "r213094/r0 "); }