add new entry types for the AFK app
This commit is contained in:
parent
bb926ee69b
commit
45a3bb5098
26
BountyEntry.cs
Normal file
26
BountyEntry.cs
Normal file
@ -0,0 +1,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EDJournal {
|
||||
/**
|
||||
* This entry appears whenever a bounty is awarded.
|
||||
*/
|
||||
public class BountyEntry : Entry {
|
||||
private string victimfaction = null;
|
||||
private string target = null;
|
||||
private int rewards = 0;
|
||||
|
||||
protected override void Initialise() {
|
||||
rewards = JSON.Value<int?>("TotalReward") ?? 0;
|
||||
victimfaction = JSON.Value<string>("VictimFaction") ?? "";
|
||||
target = JSON.Value<string>("Target_Localised") ?? "";
|
||||
}
|
||||
|
||||
public string VictimFaction => victimfaction;
|
||||
public string Target => target;
|
||||
public int Rewards => rewards;
|
||||
}
|
||||
}
|
11
Entry.cs
11
Entry.cs
@ -14,11 +14,17 @@ namespace EDJournal {
|
||||
private static readonly Dictionary<string, Type> classes = new Dictionary<string, Type> {
|
||||
{ Events.Docked, typeof(DockedEntry) },
|
||||
{ Events.FSDJump, typeof(FSDJumpEntry) },
|
||||
{ Events.MissionAccepted, typeof(MissionAcceptedEntry) },
|
||||
{ Events.MissionCompleted, typeof(MissionCompletedEntry) },
|
||||
{ Events.MissionRedirected, typeof(MissionRedirectedEntry) },
|
||||
{ Events.MultiSellExplorationData, typeof(MultiSellExplorationDataEntry) },
|
||||
{ Events.MarketSell, typeof(MarketSellEntry) },
|
||||
{ Events.SellMicroResources, typeof(SellMicroResourcesEntry) },
|
||||
{ Events.RedeemVoucher, typeof(RedeemVoucherEntry) },
|
||||
{ Events.Bounty, typeof(BountyEntry) },
|
||||
{ Events.ShipTargeted, typeof(ShipTargetedEntry) },
|
||||
{ Events.UnderAttack, typeof(UnderAttackEntry) },
|
||||
{ Events.ShieldState, typeof(ShieldStateEntry) },
|
||||
};
|
||||
|
||||
private string eventtype = null;
|
||||
@ -83,10 +89,7 @@ namespace EDJournal {
|
||||
}
|
||||
|
||||
public override string ToString() {
|
||||
if (json == null) {
|
||||
return "";
|
||||
}
|
||||
return json.ToString();
|
||||
return jsonstr ?? "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,11 +1,20 @@
|
||||
namespace EDJournal {
|
||||
public class Events {
|
||||
/**
|
||||
* A mission has been completed.
|
||||
*/
|
||||
public static readonly string MissionCompleted = "MissionCompleted";
|
||||
public static readonly string MissionAccepted = "MissionAccepted";
|
||||
public static readonly string Docked = "Docked";
|
||||
public static readonly string FSDJump = "FSDJump";
|
||||
public static readonly string MultiSellExplorationData = "MultiSellExplorationData";
|
||||
public static readonly string MarketSell = "MarketSell";
|
||||
public static readonly string SellMicroResources = "SellMicroResources";
|
||||
public static readonly string RedeemVoucher = "RedeemVoucher";
|
||||
public static readonly string Bounty = "Bounty";
|
||||
public static readonly string ShipTargeted = "ShipTargeted";
|
||||
public static readonly string ShieldState = "ShieldState";
|
||||
public static readonly string MissionRedirected = "MissionRedirected";
|
||||
public static readonly string UnderAttack = "UnderAttack";
|
||||
}
|
||||
}
|
||||
|
30
MissionAcceptedEntry.cs
Normal file
30
MissionAcceptedEntry.cs
Normal file
@ -0,0 +1,30 @@
|
||||
|
||||
namespace EDJournal {
|
||||
public class MissionAcceptedEntry : Entry {
|
||||
private string faction = null;
|
||||
private string name = null;
|
||||
private string localisedname = null;
|
||||
private string localisedtargettype = null;
|
||||
private int killcount = 0;
|
||||
private int missionid = 0;
|
||||
private int reward = 0;
|
||||
|
||||
public string Faction => faction;
|
||||
public string Name => name;
|
||||
public string LocalisedName => localisedname;
|
||||
public string LocalisedTargetType => localisedtargettype;
|
||||
public int KillCount => killcount;
|
||||
public int MissionID => missionid;
|
||||
public int Reward => reward;
|
||||
|
||||
protected override void Initialise() {
|
||||
faction = JSON.Value<string>("Faction") ?? "";
|
||||
name = JSON.Value<string>("Name") ?? "";
|
||||
localisedname = JSON.Value<string>("LocalisedName") ?? "";
|
||||
localisedtargettype = JSON.Value<string>("TargetType_Localised") ?? "";
|
||||
killcount = JSON.Value<int?>("KillCount") ?? 0;
|
||||
missionid = JSON.Value<int?>("MissionID") ?? 0;
|
||||
reward = JSON.Value<int?>("Reward") ?? 0;
|
||||
}
|
||||
}
|
||||
}
|
23
MissionRedirectedEntry.cs
Normal file
23
MissionRedirectedEntry.cs
Normal file
@ -0,0 +1,23 @@
|
||||
namespace EDJournal {
|
||||
public class MissionRedirectedEntry : Entry {
|
||||
private int missionid = 0;
|
||||
private string name = null;
|
||||
private string newdestinationstation = null;
|
||||
private string newdestinationsystem = null;
|
||||
private string olddestinationsystem = null;
|
||||
|
||||
public int MissionID => missionid;
|
||||
public string Name => name;
|
||||
public string NewDestinationStation => newdestinationstation;
|
||||
public string NewDestinationSystem => newdestinationsystem;
|
||||
public string OldDestinationSystem => olddestinationsystem;
|
||||
|
||||
protected override void Initialise() {
|
||||
missionid = JSON.Value<int?>("MissionID") ?? 0;
|
||||
name = JSON.Value<string>("Name") ?? "";
|
||||
newdestinationstation = JSON.Value<string>("NewDestinationStation") ?? "";
|
||||
newdestinationsystem = JSON.Value<string>("NewDestinationSystem") ?? "";
|
||||
olddestinationsystem = JSON.Value<string>("OldDestinationSystem") ?? "";
|
||||
}
|
||||
}
|
||||
}
|
9
ShieldStateEntry.cs
Normal file
9
ShieldStateEntry.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace EDJournal {
|
||||
public class ShieldStateEntry : Entry {
|
||||
public bool shieldsup = false;
|
||||
public bool ShieldsUp => shieldsup;
|
||||
protected override void Initialise() {
|
||||
shieldsup = JSON.Value<bool?>("ShieldsUp") ?? true;
|
||||
}
|
||||
}
|
||||
}
|
38
ShipTargetedEntry.cs
Normal file
38
ShipTargetedEntry.cs
Normal file
@ -0,0 +1,38 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace EDJournal {
|
||||
public class ShipTargetedEntry : Entry {
|
||||
private string ship = null;
|
||||
private string pilot = null;
|
||||
private string rank = null;
|
||||
private double shield = 0.0;
|
||||
private double hull = 0.0;
|
||||
private int bounty = 0;
|
||||
private string legalstatus = null;
|
||||
private string faction = null;
|
||||
|
||||
public string Ship => ship;
|
||||
public string Pilot => pilot;
|
||||
public string Rank => rank;
|
||||
public double ShieldHealth => shield;
|
||||
public double HullHealth => hull;
|
||||
public int Bounty => bounty;
|
||||
public string LegalStatus => legalstatus;
|
||||
public string Faction => faction;
|
||||
|
||||
protected override void Initialise() {
|
||||
ship = JSON.Value<string>("Ship_Localised") ?? "";
|
||||
pilot = JSON.Value<string>("PilotName_Localised") ?? "";
|
||||
rank = JSON.Value<string>("PilotRank") ?? "";
|
||||
shield = JSON.Value<double?>("ShieldHealth") ?? 0.0;
|
||||
hull = JSON.Value<double?>("HullHealth") ?? 0.0;
|
||||
bounty = JSON.Value<int?>("Bounty") ?? 0;
|
||||
legalstatus = JSON.Value<string>("LegalStatus") ?? "Clean";
|
||||
faction = JSON.Value<string>("Faction") ?? "";
|
||||
}
|
||||
}
|
||||
}
|
9
UnderAttackEntry.cs
Normal file
9
UnderAttackEntry.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace EDJournal {
|
||||
public class UnderAttackEntry : Entry {
|
||||
private string target = null;
|
||||
public string Target => target;
|
||||
protected override void Initialise() {
|
||||
target = JSON.Value<string>("Target") ?? "You";
|
||||
}
|
||||
}
|
||||
}
|
@ -44,6 +44,7 @@
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="BountyEntry.cs" />
|
||||
<Compile Include="Credits.cs" />
|
||||
<Compile Include="DockedEntry.cs" />
|
||||
<Compile Include="EliteDangerous.cs" />
|
||||
@ -54,12 +55,17 @@
|
||||
<Compile Include="JournalFile.cs" />
|
||||
<Compile Include="JournalStream.cs" />
|
||||
<Compile Include="MarketSellEntry.cs" />
|
||||
<Compile Include="MissionAcceptedEntry.cs" />
|
||||
<Compile Include="MissionCompletedEntry.cs" />
|
||||
<Compile Include="MissionRedirectedEntry.cs" />
|
||||
<Compile Include="MultiSellExplorationDataEntry.cs" />
|
||||
<Compile Include="PlayerJournal.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RedeemVoucherEntry.cs" />
|
||||
<Compile Include="SellMicroResourcesEntry.cs" />
|
||||
<Compile Include="ShieldStateEntry.cs" />
|
||||
<Compile Include="ShipTargetedEntry.cs" />
|
||||
<Compile Include="UnderAttackEntry.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
|
Loading…
Reference in New Issue
Block a user