add load game entry
This commit is contained in:
parent
2bef2a6c81
commit
3a5d4dd60f
1
Entry.cs
1
Entry.cs
@ -20,6 +20,7 @@ namespace EDJournal {
|
||||
{ Events.FactionKillBond, typeof(FactionKillBondEntry) },
|
||||
{ Events.FSDJump, typeof(FSDJumpEntry) },
|
||||
{ Events.HullDamage, typeof(HullDamageEntry) },
|
||||
{ Events.LoadGame, typeof(LoadGameEntry) },
|
||||
{ Events.Location, typeof(LocationEntry) },
|
||||
{ Events.MarketBuy, typeof(MarketBuyEntry) },
|
||||
{ Events.MarketSell, typeof(MarketSellEntry) },
|
||||
|
@ -9,6 +9,7 @@
|
||||
public static readonly string FighterDestroyed = "FighterDestroyed";
|
||||
public static readonly string FSDJump = "FSDJump";
|
||||
public static readonly string HullDamage = "HullDamage";
|
||||
public static readonly string LoadGame = "LoadGame";
|
||||
public static readonly string Location = "Location";
|
||||
public static readonly string MarketBuy = "MarketBuy";
|
||||
public static readonly string MarketSell = "MarketSell";
|
||||
|
52
LoadGameEntry.cs
Normal file
52
LoadGameEntry.cs
Normal file
@ -0,0 +1,52 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EDJournal {
|
||||
public class LoadGameEntry : Entry {
|
||||
public string Commander { get; set; }
|
||||
public string FID { get; set; }
|
||||
public bool Horizons { get; set; }
|
||||
public bool Odyssey { get; set; }
|
||||
public string Ship { get; set; }
|
||||
public long ShipID { get; set; }
|
||||
public bool StartLanded { get; set; }
|
||||
public bool StartDead { get; set; }
|
||||
public string GameMode { get; set; }
|
||||
public string Group { get; set; }
|
||||
public long Credits { get; set; }
|
||||
public long Loan { get; set; }
|
||||
public string ShipName { get; set; }
|
||||
public string ShipIdent { get; set; }
|
||||
public double FuelLevel { get; set; }
|
||||
public double FuelCapacity { get; set; }
|
||||
|
||||
protected override void Initialise() {
|
||||
Commander = JSON.Value<string>("Commander") ?? "";
|
||||
FID = JSON.Value<string>("FID") ?? "";
|
||||
// Game
|
||||
Horizons = JSON.Value<bool?>("Horizons") ?? false;
|
||||
Odyssey = JSON.Value<bool?>("Odyssey") ?? false;
|
||||
// Ships
|
||||
Ship = JSON.Value<string>("Ship") ?? "";
|
||||
ShipID = JSON.Value<long?>("ShipID") ?? 0;
|
||||
ShipName = JSON.Value<string>("ShipName") ?? "";
|
||||
ShipIdent = JSON.Value<string>("ShipIdent") ?? "";
|
||||
// Fuel
|
||||
FuelLevel = JSON.Value<double?>("FuelLevel") ?? 0.0;
|
||||
FuelCapacity = JSON.Value<double?>("FuelCapacity") ?? 0.0;
|
||||
// Landed/Dead
|
||||
StartLanded = JSON.Value<bool?>("StartLanded") ?? false;
|
||||
StartDead = JSON.Value<bool?>("StartDead") ?? false;
|
||||
// GameMode
|
||||
GameMode = JSON.Value<string>("GameMode") ?? "";
|
||||
// Group
|
||||
Group = JSON.Value<string>("Group") ?? "";
|
||||
// Wealth
|
||||
Credits = JSON.Value<long?>("Credits") ?? 0;
|
||||
Loan = JSON.Value<long?>("Loan") ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
@ -59,6 +59,7 @@
|
||||
<Compile Include="JournalException.cs" />
|
||||
<Compile Include="JournalFile.cs" />
|
||||
<Compile Include="JournalStream.cs" />
|
||||
<Compile Include="LoadGameEntry.cs" />
|
||||
<Compile Include="LocationEntry.cs" />
|
||||
<Compile Include="MarketBuyEntry.cs" />
|
||||
<Compile Include="MarketSellEntry.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user