-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathFaction.cs
More file actions
120 lines (92 loc) · 5.08 KB
/
Faction.cs
File metadata and controls
120 lines (92 loc) · 5.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using Utilities;
namespace EddiDataDefinitions
{
public class Faction
{
[PublicAPI( "The name of the faction" )]
public string name { get; set; }
[ PublicAPI( "The allegiance of the faction, if known, as an object" ) ]
public Superpower Allegiance
{
get => _allegiance ?? Superpower.None;
set => _allegiance = value;
}
private Superpower _allegiance;
[PublicAPI( "The localized allegiance of the faction, if known" ), JsonIgnore, Obsolete("Please use Allegiance instead")]
public string allegiance => Allegiance.localizedName;
[ PublicAPI( "The government of the faction, if known, as an object" ) ]
public Government Government
{
get => _government ?? Government.None;
set => _government = value;
}
private Government _government;
[PublicAPI( "The localized government of the faction, if known" ), JsonIgnore, Obsolete("Please use Government instead")]
public string government => Government.localizedName;
[PublicAPI( "Your reputation with the faction, out of 100%" )]
public decimal? myreputation { get; set; }
[PublicAPI( "True if the faction is the pilot's current squadron faction" )]
public bool squadronfaction { get; set; }
/// <summary> The faction's presence in various systems </summary>
// As this is quite dynamic data and the data we receive at any given time is likely to be incomplete,
// we won't save it to the local database at this time.
[PublicAPI( "A list of FactionPresence objects. Unless called from the *FactionDetails()* function, only details from the current system will be included here" )]
public List<FactionPresence> presences { get; set; } = [ ];
// Not intended to be user facing
/// <summary> The last time the information present changed </summary>
public long? updatedat => Dates.fromDateTimeToSeconds(updatedAt);
public DateTime updatedAt { get; set; }
}
public class FactionTrendingState ( FactionState factionState, int? trend )
{
[PublicAPI]
public FactionState factionState { get; private set; } = factionState;
[PublicAPI]
public int? trend { get; private set; } = trend;
}
public class FactionPresence
{
[PublicAPI( "The system name where this faction hasa presence" )]
public string systemName { get; set; }
[PublicAPI( "The unique 64 bit system address where this faction has a presence" )]
public ulong systemAddress { get; set; }
[PublicAPI( "The faction's current dominant state in this system, as an object" )]
public FactionState FactionState
{
get => _factionState ?? FactionState.None;
set => _factionState = value;
}
private FactionState _factionState;
[PublicAPI( "The faction's current (localized) dominant state in this system" ), JsonIgnore, Obsolete("Please use FactionState instead")]
public string state => FactionState.localizedName;
[PublicAPI( "The faction's influence level within the system, as a percentage" )]
public decimal? influence { get; set; }
[PublicAPI( "(For recently visited systems only) A list of FactionState objects" )]
public List<FactionState> ActiveStates { get; set; } = [ ];
[PublicAPI( "(For recently visited systems only) A list of pending FactionState objects and trend values" )]
public List<FactionTrendingState> PendingStates { get; set; } = [ ];
[PublicAPI( "(For recently visited systems only) A list of recent prior FactionState objects and trend values" )]
public List<FactionTrendingState> RecoveringStates { get; set; } = [ ];
[PublicAPI( "(For recently visited systems only) The current happiness level of the faction within the system, as an object" )]
public Happiness Happiness
{
get => _happiness ?? Happiness.None;
set => _happiness = value;
}
private Happiness _happiness;
[PublicAPI ( "(For recently visited systems only) The current localized happiness level of the faction within the system" ), JsonIgnore, Obsolete("Please use Happiness for code instead. This value is for use in Cottle only.")]
public string happiness => Happiness.localizedName;
// Pilot and squadron data
/// <summary> Whether the system is the happiest system in the pilot's squadron's faction's control </summary>
public bool squadronhappiestsystem { get; set; }
[PublicAPI( "(For recently visited systems only) True if the faction is the pilot's current squadron faction" )]
public bool squadronhomesystem { get; set; }
// Not intended to be user facing
/// <summary> The last time the information present changed </summary>
public long? updatedat => Dates.fromDateTimeToSeconds(updatedAt);
public DateTime updatedAt { get; set; }
}
}