2
0
mirror of https://github.com/9ParsonsB/Pulsar.git synced 2025-07-01 08:23:42 -04:00

Rework Journal Handling

Stub ModulesInfo
This commit is contained in:
2024-04-21 17:10:45 +10:00
parent 4274496150
commit b8967814d5
14 changed files with 156 additions and 47 deletions

View File

@ -277,7 +277,8 @@ using Travel;
[JsonDerivedType(typeof(OutfittingFile))]
[JsonDerivedType(typeof(ShipyardFile))]
[JsonDerivedType(typeof(Status))]
public class JournalBase
[JsonDerivedType(typeof(JournalBase))]
public interface IJournal
{
[JsonPropertyName("timestamp")]
public DateTimeOffset Timestamp { get; init; }
@ -287,4 +288,11 @@ public class JournalBase
[JsonExtensionData]
public Dictionary<string, object> AdditionalProperties { get; init; }
}
public abstract class JournalBase : IJournal
{
public DateTimeOffset Timestamp { get; init; }
public string Event { get; init; }
public Dictionary<string, object> AdditionalProperties { get; init; }
}

View File

@ -54,7 +54,7 @@ public interface IObservatoryWorker : IObservatoryPlugin
/// <param name="journal"><para>Elite Dangerous journal event, deserialized into a .NET object.</para>
/// <para>Unhandled json values within a journal entry type will be contained in member property:<br/>Dictionary&lt;string, object&gt; AdditionalProperties.</para>
/// <para>Unhandled journal event types will be type JournalBase with all values contained in AdditionalProperties.</para></param>
public void JournalEvent<TJournal>(TJournal journal) where TJournal : JournalBase;
public void JournalEvent<TJournal>(TJournal journal) where TJournal : IJournal;
/// <summary>
/// Method called when status.json content is updated.<br/>