ed_journals/modules/materials/models/
material_grade.rs

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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
use serde::Serialize;

use crate::modules::materials::Material;

#[derive(Debug, Serialize)]
pub enum MaterialGrade {
    Grade1,
    Grade2,
    Grade3,
    Grade4,
    Grade5,

    /// Used for odyssey materials
    None,

    #[cfg(feature = "allow-unknown")]
    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
    Unknown,
}

impl MaterialGrade {
    pub fn grade_nr(&self) -> u8 {
        match self {
            MaterialGrade::Grade1 => 1,
            MaterialGrade::Grade2 => 2,
            MaterialGrade::Grade3 => 3,
            MaterialGrade::Grade4 => 4,
            MaterialGrade::Grade5 => 5,
            MaterialGrade::None => 0,

            #[cfg(feature = "allow-unknown")]
            MaterialGrade::Unknown => 0,
        }
    }

    pub fn grade_storage_limit(&self) -> u16 {
        match self {
            MaterialGrade::Grade1 => 300,
            MaterialGrade::Grade2 => 250,
            MaterialGrade::Grade3 => 200,
            MaterialGrade::Grade4 => 150,
            MaterialGrade::Grade5 => 100,
            MaterialGrade::None => 0,

            #[cfg(feature = "allow-unknown")]
            MaterialGrade::Unknown => 250,
        }
    }
}

impl From<&Material> for MaterialGrade {
    fn from(value: &Material) -> Self {
        match value {
            // Raw
            Material::Carbon => MaterialGrade::Grade1,
            Material::Vanadium => MaterialGrade::Grade2,
            Material::Niobium => MaterialGrade::Grade3,
            Material::Yttrium => MaterialGrade::Grade4,

            Material::Phosphorus => MaterialGrade::Grade1,
            Material::Chromium => MaterialGrade::Grade2,
            Material::Molybdenum => MaterialGrade::Grade3,
            Material::Technetium => MaterialGrade::Grade4,

            Material::Sulphur => MaterialGrade::Grade1,
            Material::Manganese => MaterialGrade::Grade2,
            Material::Cadmium => MaterialGrade::Grade3,
            Material::Ruthenium => MaterialGrade::Grade4,

            Material::Iron => MaterialGrade::Grade1,
            Material::Zinc => MaterialGrade::Grade2,
            Material::Tin => MaterialGrade::Grade3,
            Material::Selenium => MaterialGrade::Grade4,

            Material::Nickel => MaterialGrade::Grade1,
            Material::Germanium => MaterialGrade::Grade2,
            Material::Tungsten => MaterialGrade::Grade3,
            Material::Tellurium => MaterialGrade::Grade4,

            Material::Rhenium => MaterialGrade::Grade1,
            Material::Arsenic => MaterialGrade::Grade2,
            Material::Mercury => MaterialGrade::Grade3,
            Material::Polonium => MaterialGrade::Grade4,

            Material::Lead => MaterialGrade::Grade1,
            Material::Zirconium => MaterialGrade::Grade2,
            Material::Boron => MaterialGrade::Grade3,
            Material::Antimony => MaterialGrade::Grade4,

            // Manufactured
            Material::ChemicalStorageUnits => MaterialGrade::Grade1,
            Material::ChemicalProcessors => MaterialGrade::Grade2,
            Material::ChemicalDistillery => MaterialGrade::Grade3,
            Material::ChemicalManipulators => MaterialGrade::Grade4,
            Material::PharmaceuticalIsolators => MaterialGrade::Grade5,

            Material::TemperedAlloys => MaterialGrade::Grade1,
            Material::HeatResistantCeramics => MaterialGrade::Grade2,
            Material::PrecipitatedAlloys => MaterialGrade::Grade3,
            Material::ThermicAlloys => MaterialGrade::Grade4,
            Material::MilitaryGradeAlloys => MaterialGrade::Grade5,

            Material::HeatConductionWiring => MaterialGrade::Grade1,
            Material::HeatDispersionPlate => MaterialGrade::Grade2,
            Material::HeatExchangers => MaterialGrade::Grade3,
            Material::HeatVanes => MaterialGrade::Grade4,
            Material::ProtoHeatRadiators => MaterialGrade::Grade5,

            Material::BasicConductors => MaterialGrade::Grade1,
            Material::ConductiveComponents => MaterialGrade::Grade2,
            Material::ConductiveCeramics => MaterialGrade::Grade3,
            Material::ConductivePolymers => MaterialGrade::Grade4,
            Material::BiotechConductors => MaterialGrade::Grade5,

            Material::MechanicalScrap => MaterialGrade::Grade1,
            Material::MechanicalEquipment => MaterialGrade::Grade2,
            Material::MechanicalComponents => MaterialGrade::Grade3,
            Material::ConfigurableComponents => MaterialGrade::Grade4,
            Material::ImprovisedComponents => MaterialGrade::Grade5,

            Material::GridResistors => MaterialGrade::Grade1,
            Material::HybridCapacitors => MaterialGrade::Grade2,
            Material::ElectrochemicalArrays => MaterialGrade::Grade3,
            Material::PolymerCapacitors => MaterialGrade::Grade4,
            Material::MilitarySupercapacitors => MaterialGrade::Grade5,

            Material::WornShieldEmitters => MaterialGrade::Grade1,
            Material::ShieldEmitters => MaterialGrade::Grade2,
            Material::ShieldingSensors => MaterialGrade::Grade3,
            Material::CompoundShielding => MaterialGrade::Grade4,
            Material::ImperialShielding => MaterialGrade::Grade5,

            Material::CompactComposites => MaterialGrade::Grade1,
            Material::FilamentComposites => MaterialGrade::Grade2,
            Material::HighDensityComposites => MaterialGrade::Grade3,
            Material::ProprietaryComposites => MaterialGrade::Grade4,
            Material::CoreDynamicsComposites => MaterialGrade::Grade5,

            Material::CrystalShards => MaterialGrade::Grade1,
            Material::FlawedFocusCrystals => MaterialGrade::Grade2,
            Material::FocusCrystals => MaterialGrade::Grade3,
            Material::RefinedFocusCrystals => MaterialGrade::Grade4,
            Material::ExquisiteFocusCrystals => MaterialGrade::Grade5,

            Material::SalvagedAlloys => MaterialGrade::Grade1,
            Material::GalvanisingAlloys => MaterialGrade::Grade2,
            Material::PhaseAlloys => MaterialGrade::Grade3,
            Material::ProtoLightAlloys => MaterialGrade::Grade4,
            Material::ProtoRadiolicAlloys => MaterialGrade::Grade5,

            Material::HardenedSurfaceFragments => MaterialGrade::Grade1,
            Material::CausticShard => MaterialGrade::Grade2,
            Material::TacticalCoreChip => MaterialGrade::Grade2,
            Material::ThargoidCarapace => MaterialGrade::Grade2,
            Material::BioMechanicalConduits => MaterialGrade::Grade3,
            Material::CorrosiveMechanisms => MaterialGrade::Grade3,
            Material::PhasingMembraneResidue => MaterialGrade::Grade3,
            Material::ThargoidEnergyCell => MaterialGrade::Grade3,
            Material::WreckageComponents => MaterialGrade::Grade3,
            Material::CausticCrystal => MaterialGrade::Grade4,
            Material::ThargoidTechnologicalComponents => MaterialGrade::Grade4,
            Material::WeaponParts => MaterialGrade::Grade4,
            Material::HeatExposureSpecimen => MaterialGrade::Grade5,
            Material::PropulsionElements => MaterialGrade::Grade5,
            Material::SensorFragment => MaterialGrade::Grade5,
            Material::ThargoidOrganicCircuitry => MaterialGrade::Grade5,

            Material::GuardianPowerCell => MaterialGrade::Grade1,
            Material::GuardianWreckageComponents => MaterialGrade::Grade1,
            Material::GuardianPowerConduit => MaterialGrade::Grade2,
            Material::GuardianSentinelWeaponParts => MaterialGrade::Grade3,
            Material::GuardianTechnologyComponent => MaterialGrade::Grade3,

            // Encoded
            Material::ExceptionScrambledEmissionData => MaterialGrade::Grade1,
            Material::IrregularEmissionData => MaterialGrade::Grade2,
            Material::UnexpectedEmissionData => MaterialGrade::Grade3,
            Material::DecodedEmissionData => MaterialGrade::Grade4,
            Material::AbnormalCompactEmissionData => MaterialGrade::Grade5,

            Material::AtypicalDisruptedWakeEchoes => MaterialGrade::Grade1,
            Material::AnomalousFSDTelemetry => MaterialGrade::Grade2,
            Material::StrangeWakeSolutions => MaterialGrade::Grade3,
            Material::EccentricHyperspaceTrajectories => MaterialGrade::Grade4,
            Material::DataminedWakeExceptions => MaterialGrade::Grade5,

            Material::DistortedShieldCycleRecordings => MaterialGrade::Grade1,
            Material::InconsistentShieldSoakAnalysis => MaterialGrade::Grade2,
            Material::UntypicalShieldScans => MaterialGrade::Grade3,
            Material::AberrantShieldPatternAnalysis => MaterialGrade::Grade4,
            Material::PeculiarShieldFrequencyData => MaterialGrade::Grade5,

            Material::UnusualEncryptedFiles => MaterialGrade::Grade1,
            Material::TaggedEncryptionCodes => MaterialGrade::Grade2,
            Material::OpenSymmetricKeys => MaterialGrade::Grade3,
            Material::AtypicalEncryptionArchives => MaterialGrade::Grade4,
            Material::AdaptiveEncryptorsCapture => MaterialGrade::Grade5,

            Material::AnomalousBulkScanData => MaterialGrade::Grade1,
            Material::UnidentifiedScanArchives => MaterialGrade::Grade2,
            Material::ClassifiedScanDatabanks => MaterialGrade::Grade3,
            Material::DivergentScanData => MaterialGrade::Grade4,
            Material::ClassifiedScanFragment => MaterialGrade::Grade5,

            Material::SpecializedLegacyFirmware => MaterialGrade::Grade1,
            Material::ModifiedConsumerFirmware => MaterialGrade::Grade2,
            Material::CrackedIndustrialFirmware => MaterialGrade::Grade3,
            Material::SecurityFirmwarePatch => MaterialGrade::Grade4,
            Material::ModifiedEmbeddedFirmware => MaterialGrade::Grade5,

            Material::ThargoidStructuralData => MaterialGrade::Grade2,
            Material::MassiveEnergySurgeAnalytics => MaterialGrade::Grade3,
            Material::ShipFlightData => MaterialGrade::Grade3,
            Material::ShipSystemsData => MaterialGrade::Grade3,
            Material::ThargoidInterdictionTelemetry => MaterialGrade::Grade3,
            Material::ThargoidMaterialCompositionData => MaterialGrade::Grade3,
            Material::ThargoidShipSignature => MaterialGrade::Grade3,
            Material::ThargoidResidueData => MaterialGrade::Grade4,
            Material::ThargoidWakeData => MaterialGrade::Grade4,

            Material::PatternGammaObeliskData => MaterialGrade::Grade1,
            Material::PatternBetaObeliskData => MaterialGrade::Grade2,
            Material::PatternAlphaObeliskData => MaterialGrade::Grade3,
            Material::PatternDeltaObeliskData => MaterialGrade::Grade4,
            Material::PatternEpsilonObeliskData => MaterialGrade::Grade4,
            Material::GuardianModuleBlueprintFragment => MaterialGrade::Grade5,
            Material::GuardianVesselBlueprintFragment => MaterialGrade::Grade5,
            Material::GuardianWeaponBlueprintFragment => MaterialGrade::Grade5,

            #[cfg(feature = "allow-unknown")]
            Material::Unknown(_) => MaterialGrade::Unknown,
        }
    }
}