-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathNpcAuthorityShip.cs
More file actions
57 lines (48 loc) · 2.27 KB
/
NpcAuthorityShip.cs
File metadata and controls
57 lines (48 loc) · 2.27 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
using System;
using System.Linq;
namespace EddiDataDefinitions
{
public class NpcAuthorityShip : ResourceBasedLocalizedEDName<NpcAuthorityShip>
{
static NpcAuthorityShip()
{
resourceManager = Properties.NpcAuthorityShip.ResourceManager;
resourceManager.IgnoreCase = true;
}
public static readonly NpcAuthorityShip MilitaryAlliance = new("Military_Alliance");
public static readonly NpcAuthorityShip MilitaryEmpire = new("Military_Empire");
public static readonly NpcAuthorityShip MilitaryFederation = new("Military_Federation");
public static readonly NpcAuthorityShip MilitaryIndependent = new("Military_Independent");
public static readonly NpcAuthorityShip PoliceAlliance = new("Police_Alliance");
public static readonly NpcAuthorityShip PoliceEmpire = new("Police_Empire");
public static readonly NpcAuthorityShip PoliceFederation = new("Police_Federation");
public static readonly NpcAuthorityShip PoliceIndependent = new("Police_Independent");
public static readonly NpcAuthorityShip Thargoid = new( "Thargoid" );
public static readonly NpcAuthorityShip UNKNOWN = new("UNKNOWN"); // Thargoid?
// dummy used to ensure that the static constructor has run
public NpcAuthorityShip() : this("")
{ }
private NpcAuthorityShip(string edname) : base(edname, edname)
{ }
public new static NpcAuthorityShip FromEDName(string edname)
{
if (string.IsNullOrEmpty(edname)) { return null; }
var tidiedName = titiedEDName(edname);
var result = ResourceBasedLocalizedEDName<NpcAuthorityShip>.FromEDName(tidiedName);
return result;
}
public static bool EDNameExists(string edName)
{
if (edName == null) { return false; }
return AllOfThem.Any(v => string.Equals(v.edname, titiedEDName(edName), StringComparison.InvariantCultureIgnoreCase));
}
private static string titiedEDName(string edName)
{
var tidiedName = edName?.ToLowerInvariant()
.Replace("$", "")
.Replace("shipname_", "")
.Replace(";", "");
return tidiedName;
}
}
}