-
Notifications
You must be signed in to change notification settings - Fork 91
Expand file tree
/
Copy pathAtmosphereClass.cs
More file actions
115 lines (105 loc) · 4.91 KB
/
AtmosphereClass.cs
File metadata and controls
115 lines (105 loc) · 4.91 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
using Newtonsoft.Json;
namespace EddiDataDefinitions
{
/// <summary> Atmosphere Class </summary>
[JsonObject(MemberSerialization.OptIn)]
public class AtmosphereClass : ResourceBasedLocalizedEDName<AtmosphereClass>
{
static AtmosphereClass()
{
resourceManager = Properties.AtmosphereClass.ResourceManager;
resourceManager.IgnoreCase = true;
missingEDNameHandler = (edname) => new AtmosphereClass(edname);
None = new AtmosphereClass("None");
Ammonia = new AtmosphereClass("Ammonia");
AmmoniaOxygen = new AtmosphereClass("AmmoniaOxygen");
AmmoniaAndOxygen = new AtmosphereClass("AmmoniaAndOxygen");
AmmoniaRich = new AtmosphereClass("AmmoniaRich");
Argon = new AtmosphereClass("Argon");
ArgonRich = new AtmosphereClass("ArgonRich");
CarbonDioxide = new AtmosphereClass("CarbonDioxide");
CarbonDioxideRich = new AtmosphereClass("CarbonDioxideRich");
EarthLike = new AtmosphereClass("EarthLike");
Helium = new AtmosphereClass("Helium");
Methane = new AtmosphereClass("Methane");
MethaneRich = new AtmosphereClass("MethaneRich");
MetallicVapour = new AtmosphereClass("MetallicVapour");
Neon = new AtmosphereClass("Neon");
NeonRich = new AtmosphereClass("NeonRich");
Nitrogen = new AtmosphereClass("Nitrogen");
Oxygen = new AtmosphereClass("Oxygen");
SilicateVapour = new AtmosphereClass("SilicateVapour");
SuitableForWaterBasedLife = new AtmosphereClass("SuitableForWaterBasedLife");
SulphurDioxide = new AtmosphereClass("SulphurDioxide");
Water = new AtmosphereClass("Water");
WaterRich = new AtmosphereClass("WaterRich");
// Synthetic name(s)
GasGiant = new AtmosphereClass("GasGiant");
}
public static readonly AtmosphereClass None;
public static readonly AtmosphereClass Ammonia;
public static readonly AtmosphereClass AmmoniaOxygen;
public static readonly AtmosphereClass AmmoniaAndOxygen;
public static readonly AtmosphereClass AmmoniaRich;
public static readonly AtmosphereClass Argon;
public static readonly AtmosphereClass ArgonRich;
public static readonly AtmosphereClass CarbonDioxide;
public static readonly AtmosphereClass CarbonDioxideRich;
public static readonly AtmosphereClass EarthLike;
public static readonly AtmosphereClass Helium;
public static readonly AtmosphereClass Methane;
public static readonly AtmosphereClass MethaneRich;
public static readonly AtmosphereClass MetallicVapour;
public static readonly AtmosphereClass Neon;
public static readonly AtmosphereClass NeonRich;
public static readonly AtmosphereClass Nitrogen;
public static readonly AtmosphereClass Oxygen;
public static readonly AtmosphereClass SilicateVapour;
public static readonly AtmosphereClass SuitableForWaterBasedLife;
public static readonly AtmosphereClass SulphurDioxide;
public static readonly AtmosphereClass Water;
public static readonly AtmosphereClass WaterRich;
public static readonly AtmosphereClass GasGiant;
// dummy used to ensure that the static constructor has run
public AtmosphereClass () : this("")
{ }
private AtmosphereClass(string edname) : base(edname, edname
.ToLowerInvariant()
.Replace("thick ", "")
.Replace("thin ", "")
.Replace("hot ", "")
.Replace(" ", "")
.Replace("-", ""))
{ }
new public static AtmosphereClass FromName(string name)
{
if (name == null)
{
return FromName("None");
}
// Temperature and pressure are defined separately so we remove them from this string (if descriptors are present)
var normalizedName = name
.ToLowerInvariant()
.Replace("thick ", "")
.Replace("thin ", "")
.Replace("hot ", "");
return ResourceBasedLocalizedEDName<AtmosphereClass>.FromName(normalizedName);
}
new public static AtmosphereClass FromEDName(string edname)
{
if (edname == null)
{
return FromEDName("None");
}
// Temperature and pressure are defined separately so we remove them from this string (if descriptors are present)
var normalizedEDName = edname
.ToLowerInvariant()
.Replace("thick ", "")
.Replace("thin ", "")
.Replace("hot ", "")
.Replace(" ", "")
.Replace("-", "");
return ResourceBasedLocalizedEDName<AtmosphereClass>.FromEDName(normalizedEDName);
}
}
}