add a highly rudimentary combat zone detector

This commit is contained in:
2022-11-25 17:13:17 +01:00
parent fe28a4d17d
commit 955a108f2e
7 changed files with 331 additions and 1 deletions

View File

@@ -0,0 +1,66 @@
namespace EDPlayerJournal.Entries;
public class DisembarkEntry : Entry {
/// <summary>
/// Disembarked into an SRV?
/// </summary>
public bool SRV { get; set; } = false;
/// <summary>
/// Taxi?
/// </summary>
public bool Taxi { get; set; } = false;
/// <summary>
/// Multicrew or not.
/// </summary>
public bool Multicrew { get; set; } = false;
/// <summary>
/// Player's ship ID
/// </summary>
public ulong? ID { get; set; }
/// <summary>
/// Star system
/// </summary>
public string? StarSystem { get; set; }
/// <summary>
/// System address
/// </summary>
public ulong? SystemAddress { get; set; }
/// <summary>
/// Body, name e.g. HIP 6182 B 2 a
/// </summary>
public string? Body { get; set; }
/// <summary>
/// Body ID
/// </summary>
public ulong? BodyID { get; set; }
/// <summary>
/// Disembarked on a station?
/// </summary>
public bool OnStation { get; set; } = false;
/// <summary>
/// Disembarked on a planet?
/// </summary>
public bool OnPlanet { get; set; } = false;
protected override void Initialise() {
SRV = JSON.Value<bool?>("SRV") ?? false;
Taxi = JSON.Value<bool?>("Taxi") ?? false;
Multicrew = JSON.Value<bool?>("Multicrew") ?? false;
ID = JSON.Value<ulong?>("ID");
StarSystem = JSON.Value<string?>("StarSystem");
SystemAddress = JSON.Value<ulong?>("SystemAddress");
Body = JSON.Value<string?>("Body");
BodyID = JSON.Value<ulong?>("BodyID");
OnStation = JSON.Value<bool?>("OnStation") ?? false;
OnPlanet = JSON.Value<bool?>("OnPlanet") ?? false;
}
}

View File

@@ -0,0 +1,66 @@
namespace EDPlayerJournal.Entries;
public class EmbarkEntry : Entry {
/// <summary>
/// Disembarked into an SRV?
/// </summary>
public bool SRV { get; set; } = false;
/// <summary>
/// Taxi?
/// </summary>
public bool Taxi { get; set; } = false;
/// <summary>
/// Multicrew or not.
/// </summary>
public bool Multicrew { get; set; } = false;
/// <summary>
/// Player's ship ID
/// </summary>
public ulong? ID { get; set; }
/// <summary>
/// Star system
/// </summary>
public string? StarSystem { get; set; }
/// <summary>
/// System address
/// </summary>
public ulong? SystemAddress { get; set; }
/// <summary>
/// Body, name e.g. HIP 6182 B 2 a
/// </summary>
public string? Body { get; set; }
/// <summary>
/// Body ID
/// </summary>
public ulong? BodyID { get; set; }
/// <summary>
/// Disembarked on a station?
/// </summary>
public bool OnStation { get; set; } = false;
/// <summary>
/// Disembarked on a planet?
/// </summary>
public bool OnPlanet { get; set; } = false;
protected override void Initialise() {
SRV = JSON.Value<bool?>("SRV") ?? false;
Taxi = JSON.Value<bool?>("Taxi") ?? false;
Multicrew = JSON.Value<bool?>("Multicrew") ?? false;
ID = JSON.Value<ulong?>("ID");
StarSystem = JSON.Value<string?>("StarSystem");
SystemAddress = JSON.Value<ulong?>("SystemAddress");
Body = JSON.Value<string?>("Body");
BodyID = JSON.Value<ulong?>("BodyID");
OnStation = JSON.Value<bool?>("OnStation") ?? false;
OnPlanet = JSON.Value<bool?>("OnPlanet") ?? false;
}
}

View File

@@ -16,9 +16,11 @@ public class Entry {
{ Events.Commander, typeof(CommanderEntry) },
{ Events.CommitCrime, typeof(CommitCrimeEntry) },
{ Events.Died, typeof(DiedEntry) },
{ Events.Disembark, typeof(DisembarkEntry) },
{ Events.Docked, typeof(DockedEntry) },
{ Events.FileHeader, typeof(FileHeaderEntry) },
{ Events.Embark, typeof(EmbarkEntry) },
{ Events.FactionKillBond, typeof(FactionKillBondEntry) },
{ Events.FileHeader, typeof(FileHeaderEntry) },
{ Events.FSDJump, typeof(FSDJumpEntry) },
{ Events.HullDamage, typeof(HullDamageEntry) },
{ Events.LoadGame, typeof(LoadGameEntry) },
@@ -39,6 +41,8 @@ public class Entry {
{ Events.SellOrganicData, typeof(SellOrganicDataEntry) },
{ Events.ShieldState, typeof(ShieldStateEntry) },
{ Events.ShipTargeted, typeof(ShipTargetedEntry) },
{ Events.SupercruiseEntry, typeof(SupercruiseEntryEntry) },
{ Events.SupercruiseExit, typeof(SupercruiseExitEntry) },
{ Events.UnderAttack, typeof(UnderAttackEntry) },
};

View File

@@ -5,7 +5,9 @@ public class Events {
public static readonly string Commander = "Commander";
public static readonly string CommitCrime = "CommitCrime";
public static readonly string Died = "Died";
public static readonly string Disembark = "Disembark";
public static readonly string Docked = "Docked";
public static readonly string Embark = "Embark";
public static readonly string FactionKillBond = "FactionKillBond";
public static readonly string FighterDestroyed = "FighterDestroyed";
public static readonly string FileHeader = "Fileheader";
@@ -29,5 +31,8 @@ public class Events {
public static readonly string SellOrganicData = "SellOrganicData";
public static readonly string ShieldState = "ShieldState";
public static readonly string ShipTargeted = "ShipTargeted";
public static readonly string Shutdown = "Shutdown";
public static readonly string SupercruiseEntry = "SupercruiseEntry";
public static readonly string SupercruiseExit = "SupercruiseExit";
public static readonly string UnderAttack = "UnderAttack";
}

View File

@@ -0,0 +1,30 @@
namespace EDPlayerJournal.Entries;
public class SupercruiseEntryEntry : Entry {
/// <summary>
/// Taxi?
/// </summary>
public bool Taxi { get; set; } = false;
/// <summary>
/// Multicrew or not.
/// </summary>
public bool Multicrew { get; set; } = false;
/// <summary>
/// Star system
/// </summary>
public string? StarSystem { get; set; }
/// <summary>
/// System address
/// </summary>
public ulong? SystemAddress { get; set; }
protected override void Initialise() {
Taxi = JSON.Value<bool?>("Taxi") ?? false;
Multicrew = JSON.Value<bool?>("Multicrew") ?? false;
StarSystem = JSON.Value<string?>("StarSystem");
SystemAddress = JSON.Value<ulong?>("SystemAddress");
}
}

View File

@@ -0,0 +1,48 @@
namespace EDPlayerJournal.Entries;
public class SupercruiseExitEntry : Entry {
/// <summary>
/// Taxi?
/// </summary>
public bool Taxi { get; set; } = false;
/// <summary>
/// Multicrew or not.
/// </summary>
public bool Multicrew { get; set; } = false;
/// <summary>
/// Star system
/// </summary>
public string? StarSystem { get; set; }
/// <summary>
/// System address
/// </summary>
public ulong? SystemAddress { get; set; }
/// <summary>
/// Body, name e.g. HIP 6182 B 2 a
/// </summary>
public string? Body { get; set; }
/// <summary>
/// Body ID
/// </summary>
public ulong? BodyID { get; set; }
/// <summary>
/// Body type (star, planet etc.)
/// </summary>
public string? BodyType { get; set; }
protected override void Initialise() {
Taxi = JSON.Value<bool?>("Taxi") ?? false;
Multicrew = JSON.Value<bool?>("Multicrew") ?? false;
StarSystem = JSON.Value<string?>("StarSystem");
SystemAddress = JSON.Value<ulong?>("SystemAddress");
Body = JSON.Value<string?>("Body");
BodyType = JSON.Value<string?>("BodyType");
BodyID = JSON.Value<ulong?>("BodyID");
}
}