ed_journals/modules/exobiology/models/
species.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
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
use crate::exobiology::Genus;
use crate::exploration::shared::codex_regex::CODEX_REGEX;
use crate::from_str_deserialize_impl;
use crate::modules::exobiology::models::spawn_condition::SpawnCondition;
use crate::modules::exobiology::r#static::species_spawn_conditions::SPECIES_SPAWN_CONDITIONS;
use lazy_static::lazy_static;
use serde::Serialize;
use std::fmt::{Display, Formatter};
use std::str::FromStr;
use strum::EnumIter;
use thiserror::Error;

#[derive(Debug, Serialize, Clone, Hash, Eq, PartialEq, EnumIter)]
pub enum Species {
    // Aleoids
    AleoidaArcus,
    AleoidaCoronamus,
    AleoidaSpica,
    AleoidaLaminiae,
    AleoidaGravis,

    // Amphora plant
    AmphoraPlant,

    // Anemones
    AnemoneLuteolum,               // TODO needs to be verified
    AnemoneCroceum,                // TODO needs to be verified
    AnemonePuniceum,               // TODO needs to be verified
    AnemoneRoseum,                 // TODO needs to be verified
    AnemoneBlatteumBioluminescent, // TODO needs to be verified
    AnemoneRubeumBioluminescent,   // TODO needs to be verified
    AnemonePrasinumBioluminescent, // TODO needs to be verified
    AnemoneRoseumBioluminescent,   // TODO needs to be verified

    // Bark mounds
    BarkMound,

    // Bacterium
    BacteriumAurasus,
    BacteriumNebulus,
    BacteriumScopulum,
    BacteriumAcies,
    BacteriumVesicula,
    BacteriumAlcyoneum,
    BacteriumTela,
    BacteriumInformem,
    BacteriumVolu,
    BacteriumBullaris,
    BacteriumOmentum,
    BacteriumCerbrus,
    BacteriumVerrata,

    // Brain tree
    BrainTreeRoseum,       // TODO needs to be verified
    BrainTreeGypseeum,     // TODO needs to be verified
    BrainTreeOstrinum,     // TODO needs to be verified
    BrainTreeViride,       // TODO needs to be verified
    BrainTreeLividum,      // TODO needs to be verified
    BrainTreeAureum,       // TODO needs to be verified
    BrainTreePuniceum,     // TODO needs to be verified
    BrainTreeLindigoticum, // TODO needs to be verified

    // Cactoida
    CactoidaCortexum,
    CactoidaLapis,
    CactoidaVermis,
    CactoidaPullulanta,
    CactoidaPeperatis,

    // Clypeus
    ClypeusLacrimam,
    ClypeusMargaritus,
    ClypeusSpeculumi,

    // Conchas
    ConchaRenibus,
    ConchaAureolas,
    ConchaLabiata,
    ConchaBiconcavis,

    // Crystalline shards
    CrystallineShards,

    // Electricae
    ElectricaePluma,
    ElectricaeRadialem,

    // Fonticulus
    FonticuluaSegmentatus,
    FonticuluaCampestris,
    FonticuluaUpupam,
    FonticuluaLapida,
    FonticuluaFluctus,
    FonticuluaDigitos,

    // Frutexa
    FrutexaFlabellum,
    FrutexaAcus,
    FrutexaMetallicum,
    FrutexaFlammasis,
    FrutexaFera,
    FrutexaSponsae,
    FrutexaCollum,

    // Fumerola
    FumerolaCarbosis,
    FumerolaExtremus,
    FumerolaNitris,
    FumerolaAquatis,

    // Fungoida
    FungoidaSetisis,
    FungoidaStabitis,
    FungoidaBullarum,
    FungoidaGelata,

    // Osseus
    OsseusFractus,
    OsseusDiscus,
    OsseusSpiralis,
    OsseusPumice,
    OsseusCornibus,
    OsseusPellebantus,

    // Recepta
    ReceptaUmbrux,
    ReceptaDeltahedronix,
    ReceptaConditivus,

    // Sinuous tubers
    SinuousTubersRoseum,       // TODO needs to be verified
    SinuousTubersPrasinum,     // TODO needs to be verified
    SinuousTubersAlbidum,      // TODO needs to be verified
    SinuousTubersCaeruleum,    // TODO needs to be verified
    SinuousTubersBlatteum,     // TODO needs to be verified
    SinuousTubersLindigoticum, // TODO needs to be verified
    SinuousTubersViolaceum,    // TODO needs to be verified
    SinuousTubersViride,       // TODO needs to be verified

    // Stratum
    StratumExcutitus,
    StratumPaleas,
    StratumLaminamus,
    StratumAraneamus,
    StratumLimaxus,
    StratumCucumisis,
    StratumTectonicas,
    StratumFrigus,

    // Tubus
    TubusConifer,
    TubusSororibus,
    TubusCavas,
    TubusRosarium,
    TubusCompagibus,

    // Tussock
    TussockPennata,
    TussockVentusa,
    TussockIgnis,
    TussockCultro,
    TussockCatena,
    TussockPennatis,
    TussockSerrati,
    TussockAlbata,
    TussockPropagito,
    TussockDivisa,
    TussockCaputus,
    TussockTriticum,
    TussockStigmasis,
    TussockVirgam,
    TussockCapillum,

    // Thargoid barnacles
    ThargoidBarnacleCommon,          // TODO needs to be verified
    ThargoidBarnacleLarge,           // TODO needs to be verified
    ThargoidBarnacleBarbs,           // TODO needs to be verified
    ThargoidBarnacleMatrixSubmerged, // TODO needs to be verified
    ThargoidBarnacleMatrix,          // TODO needs to be verified

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

lazy_static! {
    static ref UNKNOWN_SPAWN_CONDITIONS: &'static [SpawnCondition<'static>] =
        &[SpawnCondition::Special];
}

impl Species {
    /// Whether the current variant is unknown.
    #[cfg(feature = "allow-unknown")]
    #[cfg_attr(docsrs, doc(cfg(feature = "allow-unknown")))]
    pub fn is_unknown(&self) -> bool {
        matches!(self, Species::Unknown(_))
    }

    pub fn spawn_conditions(&self) -> &[SpawnCondition<'_>] {
        #[cfg(feature = "allow-unknown")]
        if let Species::Unknown(_) = self {
            return &UNKNOWN_SPAWN_CONDITIONS;
        }

        SPECIES_SPAWN_CONDITIONS
            .iter()
            .find(|(species, _)| species == self)
            .expect("Species should always have a matching spawning condition")
            .1
    }

    pub fn genus(&self) -> Genus {
        self.into()
    }

    pub fn base_value(&self) -> u64 {
        match self {
            Species::AleoidaArcus => 7_252_500,
            Species::AleoidaCoronamus => 6_284_600,
            Species::AleoidaSpica => 3_385_200,
            Species::AleoidaLaminiae => 3_385_200,
            Species::AleoidaGravis => 12_934_900,

            // TODO this needs a value
            Species::AmphoraPlant => 0,

            // TODO these need values
            Species::AnemoneLuteolum => 0,
            Species::AnemoneCroceum => 0,
            Species::AnemonePuniceum => 0,
            Species::AnemoneRoseum => 0,
            Species::AnemoneBlatteumBioluminescent => 0,
            Species::AnemoneRubeumBioluminescent => 0,
            Species::AnemonePrasinumBioluminescent => 0,
            Species::AnemoneRoseumBioluminescent => 0,

            // TODO this needs a value
            Species::BarkMound => 0,

            Species::BacteriumAurasus => 1_000_000,
            Species::BacteriumNebulus => 5_289_900,
            Species::BacteriumScopulum => 4_934_500,
            Species::BacteriumAcies => 1_000_000,
            Species::BacteriumVesicula => 1_000_000,
            Species::BacteriumAlcyoneum => 1_658_500,
            Species::BacteriumTela => 1_949_000,
            Species::BacteriumInformem => 8_418_000,
            Species::BacteriumVolu => 7_774_700,
            Species::BacteriumBullaris => 1_152_500,
            Species::BacteriumOmentum => 4_689_800,
            Species::BacteriumCerbrus => 1_689_800,
            Species::BacteriumVerrata => 3_897_000,

            // TODO these need values
            Species::BrainTreeRoseum => 0,
            Species::BrainTreeGypseeum => 0,
            Species::BrainTreeOstrinum => 0,
            Species::BrainTreeViride => 0,
            Species::BrainTreeLividum => 0,
            Species::BrainTreeAureum => 0,
            Species::BrainTreePuniceum => 0,
            Species::BrainTreeLindigoticum => 0,

            Species::CactoidaCortexum => 3_667_600,
            Species::CactoidaLapis => 2_483_600,
            Species::CactoidaVermis => 16_202_800,
            Species::CactoidaPullulanta => 3_667_600,
            Species::CactoidaPeperatis => 2_483_600,

            Species::ClypeusLacrimam => 8_418_000,
            Species::ClypeusMargaritus => 11_873_200,
            Species::ClypeusSpeculumi => 16_202_800,

            Species::ConchaRenibus => 4_572_400,
            Species::ConchaAureolas => 7_774_700,
            Species::ConchaLabiata => 2_352_400,
            Species::ConchaBiconcavis => 19_010_800,

            Species::CrystallineShards => 1_628_800,

            Species::ElectricaePluma => 6_284_600,
            Species::ElectricaeRadialem => 6_284_600,

            Species::FonticuluaSegmentatus => 19_010_800,
            Species::FonticuluaCampestris => 1_000_000,
            Species::FonticuluaUpupam => 5_727_600,
            Species::FonticuluaLapida => 3_111_000,
            Species::FonticuluaFluctus => 20_000_000,
            Species::FonticuluaDigitos => 1_804_100,

            Species::FumerolaCarbosis => 6_284_600,
            Species::FumerolaExtremus => 16_202_800,
            Species::FumerolaNitris => 7_500_900,
            Species::FumerolaAquatis => 6_284_600,

            Species::FungoidaSetisis => 1_670_100,
            Species::FungoidaStabitis => 2_680_300,
            Species::FungoidaBullarum => 3_703_200,
            Species::FungoidaGelata => 3_330_300,

            Species::OsseusFractus => 4_027_800,
            Species::OsseusDiscus => 12_934_900,
            Species::OsseusSpiralis => 2_404_700,
            Species::OsseusPumice => 3_156_300,
            Species::OsseusCornibus => 1_483_000,
            Species::OsseusPellebantus => 9_739_000,

            Species::ReceptaUmbrux => 12_934_900,
            Species::ReceptaDeltahedronix => 16_202_800,
            Species::ReceptaConditivus => 14_313_700,

            Species::StratumExcutitus => 2_448_900,
            Species::StratumPaleas => 1_362_000,
            Species::StratumLaminamus => 2_788_300,
            Species::StratumAraneamus => 2_448_900,
            Species::StratumLimaxus => 1_362_000,
            Species::StratumCucumisis => 16_202_800,
            Species::StratumTectonicas => 19_010_800,
            Species::StratumFrigus => 2_637_500,

            Species::TubusConifer => 2_415_500,
            Species::TubusSororibus => 5_727_600,
            Species::TubusCavas => 11_873_200,
            Species::TubusRosarium => 2_637_500,
            Species::TubusCompagibus => 7_774_700,

            Species::FrutexaFlabellum => 1_808_900,
            Species::FrutexaAcus => 7_774_700,
            Species::FrutexaMetallicum => 1_632_500,
            Species::FrutexaFlammasis => 10_326_000,
            Species::FrutexaFera => 1_632_500,
            Species::FrutexaSponsae => 5_988_000,
            Species::FrutexaCollum => 1_639_800,

            Species::TussockPennata => 5_853_800,
            Species::TussockVentusa => 3_227_700,
            Species::TussockIgnis => 1_849_000,
            Species::TussockCultro => 1_766_600,
            Species::TussockCatena => 1_766_600,
            Species::TussockPennatis => 1_000_000,
            Species::TussockSerrati => 4_447_100,
            Species::TussockAlbata => 3_252_500,
            Species::TussockPropagito => 1_000_000,
            Species::TussockDivisa => 1_766_600,
            Species::TussockCaputus => 3_472_400,
            Species::TussockTriticum => 7_774_700,
            Species::TussockStigmasis => 19_010_800,
            Species::TussockVirgam => 14_313_700,
            Species::TussockCapillum => 7_025_800,

            // TODO these need values
            Species::ThargoidBarnacleCommon => 0,
            Species::ThargoidBarnacleLarge => 0,
            Species::ThargoidBarnacleBarbs => 0,
            Species::ThargoidBarnacleMatrixSubmerged => 0,
            Species::ThargoidBarnacleMatrix => 2_313_500,

            // TODO these need values
            Species::SinuousTubersRoseum => 0,
            Species::SinuousTubersPrasinum => 0,
            Species::SinuousTubersAlbidum => 0,
            Species::SinuousTubersCaeruleum => 0,
            Species::SinuousTubersBlatteum => 0,
            Species::SinuousTubersLindigoticum => 0,
            Species::SinuousTubersViolaceum => 0,
            Species::SinuousTubersViride => 0,

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

#[derive(Debug, Error)]
pub enum SpeciesError {
    #[error("Failed to parse species: '{0}'")]
    FailedToParse(String),

    #[error("Unknown species: '{0}'")]
    UnknownSpecies(String),
}

impl FromStr for Species {
    type Err = SpeciesError;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        let Some(captures) = CODEX_REGEX.captures(s) else {
            return Err(SpeciesError::FailedToParse(s.to_string()));
        };

        let string: &str = &captures
            .get(1)
            .expect("Should have been captured already")
            .as_str()
            .to_ascii_lowercase();

        Ok(match string {
            "aleoids_01" => Species::AleoidaArcus,
            "aleoids_02" => Species::AleoidaCoronamus,
            "aleoids_03" => Species::AleoidaSpica,
            "aleoids_04" => Species::AleoidaLaminiae,
            "aleoids_05" => Species::AleoidaGravis,

            "vents" => Species::AmphoraPlant,

            "sphere" => Species::AnemoneLuteolum,
            "sphereabcd_01" => Species::AnemoneCroceum,
            "sphereabcd_02" => Species::AnemonePuniceum,
            "sphereabcd_03" => Species::AnemoneRoseum,
            "sphereefgh" => Species::AnemoneBlatteumBioluminescent,
            "sphereefgh_01" => Species::AnemoneRubeumBioluminescent,
            "sphereefgh_02" => Species::AnemonePrasinumBioluminescent,
            "sphereefgh_03" => Species::AnemoneRoseumBioluminescent,

            "cone" => Species::BarkMound,

            "bacterial_01" => Species::BacteriumAurasus,
            "bacterial_02" => Species::BacteriumNebulus,
            "bacterial_03" => Species::BacteriumScopulum,
            "bacterial_04" => Species::BacteriumAcies,
            "bacterial_05" => Species::BacteriumVesicula,
            "bacterial_06" => Species::BacteriumAlcyoneum,
            "bacterial_07" => Species::BacteriumTela,
            "bacterial_08" => Species::BacteriumInformem,
            "bacterial_09" => Species::BacteriumVolu,
            "bacterial_10" => Species::BacteriumBullaris,
            "bacterial_11" => Species::BacteriumOmentum,
            "bacterial_12" => Species::BacteriumCerbrus,
            "bacterial_13" => Species::BacteriumVerrata,

            "seed" => Species::BrainTreeRoseum,
            "seedabcd_01" => Species::BrainTreeGypseeum,
            "seedabcd_02" => Species::BrainTreeOstrinum,
            "seedabcd_03" => Species::BrainTreeViride,
            "seedefgh" => Species::BrainTreeLividum,
            "seedefgh_01" => Species::BrainTreeAureum,
            "seedefgh_02" => Species::BrainTreePuniceum,
            "seedefgh_03" => Species::BrainTreeLindigoticum,

            "cactoid_01" => Species::CactoidaCortexum,
            "cactoid_02" => Species::CactoidaLapis,
            "cactoid_03" => Species::CactoidaVermis,
            "cactoid_04" => Species::CactoidaPullulanta,
            "cactoid_05" => Species::CactoidaPeperatis,

            "clypeus_01" => Species::ClypeusLacrimam,
            "clypeus_02" => Species::ClypeusMargaritus,
            "clypeus_03" => Species::ClypeusSpeculumi,

            "conchas_01" => Species::ConchaRenibus,
            "conchas_02" => Species::ConchaAureolas,
            "conchas_03" => Species::ConchaLabiata,
            "conchas_04" => Species::ConchaBiconcavis,

            "ground_struct_ice" => Species::CrystallineShards,

            "electricae_01" => Species::ElectricaePluma,
            "electricae_02" => Species::ElectricaeRadialem,

            "fonticulus_01" => Species::FonticuluaSegmentatus,
            "fonticulus_02" => Species::FonticuluaCampestris,
            "fonticulus_03" => Species::FonticuluaUpupam,
            "fonticulus_04" => Species::FonticuluaLapida,
            "fonticulus_05" => Species::FonticuluaFluctus,
            "fonticulus_06" => Species::FonticuluaDigitos,

            "shrubs_01" => Species::FrutexaFlabellum,
            "shrubs_02" => Species::FrutexaAcus,
            "shrubs_03" => Species::FrutexaMetallicum,
            "shrubs_04" => Species::FrutexaFlammasis,
            "shrubs_05" => Species::FrutexaFera,
            "shrubs_06" => Species::FrutexaSponsae,
            "shrubs_07" => Species::FrutexaCollum,

            "fumerolas_01" => Species::FumerolaCarbosis,
            "fumerolas_02" => Species::FumerolaExtremus,
            "fumerolas_03" => Species::FumerolaNitris,
            "fumerolas_04" => Species::FumerolaAquatis,

            "fungoids_01" => Species::FungoidaSetisis,
            "fungoids_02" => Species::FungoidaStabitis,
            "fungoids_03" => Species::FungoidaBullarum,
            "fungoids_04" => Species::FungoidaGelata,

            "osseus_01" => Species::OsseusFractus,
            "osseus_02" => Species::OsseusDiscus,
            "osseus_03" => Species::OsseusSpiralis,
            "osseus_04" => Species::OsseusPumice,
            "osseus_05" => Species::OsseusCornibus,
            "osseus_06" => Species::OsseusPellebantus,

            "recepta_01" => Species::ReceptaUmbrux,
            "recepta_02" => Species::ReceptaDeltahedronix,
            "recepta_03" => Species::ReceptaConditivus,

            "tube" => Species::SinuousTubersRoseum,
            "tubeabcd_01" => Species::SinuousTubersPrasinum,
            "tubeabcd_02" => Species::SinuousTubersAlbidum,
            "tubeabcd_03" => Species::SinuousTubersCaeruleum,
            "tubeefgh" => Species::SinuousTubersBlatteum,
            "tubeefgh_01" => Species::SinuousTubersLindigoticum,
            "tubeefgh_02" => Species::SinuousTubersViolaceum,
            "tubeefgh_03" => Species::SinuousTubersViride,

            "stratum_01" => Species::StratumExcutitus,
            "stratum_02" => Species::StratumPaleas,
            "stratum_03" => Species::StratumLaminamus,
            "stratum_04" => Species::StratumAraneamus,
            "stratum_05" => Species::StratumLimaxus,
            "stratum_06" => Species::StratumCucumisis,
            "stratum_07" => Species::StratumTectonicas,
            "stratum_08" => Species::StratumFrigus,

            "tubus_01" => Species::TubusConifer,
            "tubus_02" => Species::TubusSororibus,
            "tubus_03" => Species::TubusCavas,
            "tubus_04" => Species::TubusRosarium,
            "tubus_05" => Species::TubusCompagibus,

            "tussocks_01" => Species::TussockPennata,
            "tussocks_02" => Species::TussockVentusa,
            "tussocks_03" => Species::TussockIgnis,
            "tussocks_04" => Species::TussockCultro,
            "tussocks_05" => Species::TussockCatena,
            "tussocks_06" => Species::TussockPennatis,
            "tussocks_07" => Species::TussockSerrati,
            "tussocks_08" => Species::TussockAlbata,
            "tussocks_09" => Species::TussockPropagito,
            "tussocks_10" => Species::TussockDivisa,
            "tussocks_11" => Species::TussockCaputus,
            "tussocks_12" => Species::TussockTriticum,
            "tussocks_13" => Species::TussockStigmasis,
            "tussocks_14" => Species::TussockVirgam,
            "tussocks_15" => Species::TussockCapillum,

            "thargoid_barnacle_01" => Species::ThargoidBarnacleCommon,
            "thargoid_barnacle_02" => Species::ThargoidBarnacleLarge,
            "thargoid_barnacle_spikes" => Species::ThargoidBarnacleBarbs,
            "thargoid_barnacle_matrix_submerged" => Species::ThargoidBarnacleMatrixSubmerged,
            "thargoid_barnacle_matrix" => Species::ThargoidBarnacleMatrix,

            #[cfg(feature = "allow-unknown")]
            _ => Species::Unknown(s.to_string()),

            #[cfg(not(feature = "allow-unknown"))]
            _ => return Err(SpeciesError::UnknownSpecies(s.to_string())),
        })
    }
}

from_str_deserialize_impl!(Species);

impl Display for Species {
    fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
        write!(
            f,
            "{}",
            match self {
                Species::AleoidaArcus => "Aleoida Arcus",
                Species::AleoidaCoronamus => "Aleoida Coronamus",
                Species::AleoidaGravis => "Aleoida Gravis",
                Species::AleoidaLaminiae => "Aleoida Laminiae",
                Species::AleoidaSpica => "Aleoida Spica",
                Species::AmphoraPlant => "Amphora Plant",

                Species::AnemoneLuteolum => "Luteolum Anemone",
                Species::AnemoneBlatteumBioluminescent => "Blatteum Bioluminescent Anemone",
                Species::AnemoneCroceum => "Croceum Anemone",
                Species::AnemonePrasinumBioluminescent => "Prasinum Bioluminescent Anemone",
                Species::AnemonePuniceum => "Puniceum Anemone",
                Species::AnemoneRoseum => "Roseum Anemone",
                Species::AnemoneRoseumBioluminescent => "Roseum Bioluminescent Anemone",
                Species::AnemoneRubeumBioluminescent => "Rubeum Bioluminescent Anemone",

                Species::BarkMound => "Bark Mound",

                Species::BacteriumAcies => "Bacterium Acies",
                Species::BacteriumAlcyoneum => "Bacterium Alcyoneum",
                Species::BacteriumAurasus => "Bacterium Aurasus",
                Species::BacteriumBullaris => "Bacterium Bullaris",
                Species::BacteriumCerbrus => "Bacterium Cerbrus",
                Species::BacteriumInformem => "Bacterium Informem",
                Species::BacteriumNebulus => "Bacterium Nebulus",
                Species::BacteriumOmentum => "Bacterium Omentum",
                Species::BacteriumScopulum => "Bacterium Scopulum",
                Species::BacteriumTela => "Bacterium Tela",
                Species::BacteriumVerrata => "Bacterium Verrata",
                Species::BacteriumVesicula => "Bacterium Vesicula",
                Species::BacteriumVolu => "Bacterium Volu",

                Species::BrainTreeAureum => "Aureum Brain Tree ",
                Species::BrainTreeGypseeum => "Gypseeum Brain Tree ",
                Species::BrainTreeLindigoticum => "Lindigoticum Brain Tree ",
                Species::BrainTreeLividum => "Lividum Brain Tree ",
                Species::BrainTreeOstrinum => "Ostrinum Brain Tree ",
                Species::BrainTreePuniceum => "Puniceum Brain Tree ",
                Species::BrainTreeRoseum => "Roseum Brain Tree ",
                Species::BrainTreeViride => "Viride Brain Tree ",

                Species::CactoidaCortexum => "Cactoida Cortexum",
                Species::CactoidaLapis => "Cactoida Lapis",
                Species::CactoidaPullulanta => "Cactoida Pullulanta",
                Species::CactoidaVermis => "Cactoida Vermis",
                Species::CactoidaPeperatis => "Cactoida Peperatis",

                Species::CrystallineShards => "Crystaline Shards",

                Species::ClypeusLacrimam => "Clypeus Lacrimam",
                Species::ClypeusMargaritus => "Clypeus Margaritus",
                Species::ClypeusSpeculumi => "Clypeus Speculumi",

                Species::ConchaAureolas => "Concha Aureolas",
                Species::ConchaBiconcavis => "Concha Biconcavis",
                Species::ConchaLabiata => "Concha Labiata",
                Species::ConchaRenibus => "Concha Renibus",

                Species::ElectricaePluma => "Electricae Pluma",
                Species::ElectricaeRadialem => "Electricae Radialem",

                Species::FonticuluaCampestris => "Fonticulua Campestris",
                Species::FonticuluaDigitos => "Fonticulua Digitos",
                Species::FonticuluaFluctus => "Fonticulua Fluctus",
                Species::FonticuluaLapida => "Fonticulua Lapida",
                Species::FonticuluaSegmentatus => "Fonticulua Segmentatus",
                Species::FonticuluaUpupam => "Fonticulua Upupam",

                Species::FrutexaAcus => "Frutexa Acus",
                Species::FrutexaCollum => "Frutexa Collum",
                Species::FrutexaFera => "Frutexa Fera",
                Species::FrutexaFlabellum => "Frutexa Flabellum",
                Species::FrutexaFlammasis => "Frutexa Flammasis",
                Species::FrutexaMetallicum => "Frutexa Metallicum",
                Species::FrutexaSponsae => "Frutexa Sponsae",

                Species::FumerolaAquatis => "Fumerola Aquatis",
                Species::FumerolaCarbosis => "Fumerola Carbosis",
                Species::FumerolaExtremus => "Fumerola Extremus",
                Species::FumerolaNitris => "Fumerola Nitris",

                Species::FungoidaBullarum => "Fungoida Bullarum",
                Species::FungoidaGelata => "Fungoida Gelata",
                Species::FungoidaSetisis => "Fungoida Setisis",
                Species::FungoidaStabitis => "Fungoida Stabitis",

                Species::OsseusCornibus => "Osseus Cornibus",
                Species::OsseusDiscus => "Osseus Discus",
                Species::OsseusFractus => "Osseus Fractus",
                Species::OsseusPellebantus => "Osseus Pellebantus",
                Species::OsseusPumice => "Osseus Pumice",
                Species::OsseusSpiralis => "Osseus Spiralis",

                Species::ReceptaConditivus => "Recepta Conditivus",
                Species::ReceptaDeltahedronix => "Recepta Deltahedronix",
                Species::ReceptaUmbrux => "Recepta Umbrux",

                Species::SinuousTubersAlbidum => "Albidum Sinuous Tubers",
                Species::SinuousTubersBlatteum => "Blatteum Sinuous Tubers",
                Species::SinuousTubersCaeruleum => "Caeruleum Sinuous Tubers",
                Species::SinuousTubersLindigoticum => "Lindigoticum Sinuous Tubers",
                Species::SinuousTubersPrasinum => "Prasinum Sinuous Tubers",
                Species::SinuousTubersRoseum => "Roseum Sinuous Tubers",
                Species::SinuousTubersViolaceum => "Violaceum Sinuous Tubers",
                Species::SinuousTubersViride => "Viride Sinuous Tubers",

                Species::StratumAraneamus => "Stratum Araneamus",
                Species::StratumCucumisis => "Stratum Cucumisis",
                Species::StratumExcutitus => "Stratum Excutitus",
                Species::StratumFrigus => "Stratum Frigus",
                Species::StratumLaminamus => "Stratum Laminamus",
                Species::StratumLimaxus => "Stratum Limaxus",
                Species::StratumPaleas => "Stratum Paleas",
                Species::StratumTectonicas => "Stratum Tectonicas",

                Species::TubusCavas => "Tubus Cavas",
                Species::TubusCompagibus => "Tubus Compagibus",
                Species::TubusConifer => "Tubus Conifer",
                Species::TubusRosarium => "Tubus Rosarium",
                Species::TubusSororibus => "Tubus Sororibus",

                Species::TussockAlbata => "Tussock Albata",
                Species::TussockCapillum => "Tussock Capillum",
                Species::TussockCaputus => "Tussock Caputus",
                Species::TussockCatena => "Tussock Catena",
                Species::TussockCultro => "Tussock Cultro",
                Species::TussockDivisa => "Tussock Divisa",
                Species::TussockIgnis => "Tussock Ignis",
                Species::TussockPennata => "Tussock Pennata",
                Species::TussockPennatis => "Tussock Pennatis",
                Species::TussockPropagito => "Tussock Propagito",
                Species::TussockSerrati => "Tussock Serrati",
                Species::TussockStigmasis => "Tussock Stigmasis",
                Species::TussockTriticum => "Tussock Triticum",
                Species::TussockVentusa => "Tussock Ventusa",
                Species::TussockVirgam => "Tussock Virgam",

                Species::ThargoidBarnacleCommon => "Common Thargoid Barnacle",
                Species::ThargoidBarnacleLarge => "Large Thargoid Barnacle",
                Species::ThargoidBarnacleBarbs => "Thargoid Barnacle Barbs",
                Species::ThargoidBarnacleMatrixSubmerged => "Thargoid Barnacle Matrix Submerged",
                Species::ThargoidBarnacleMatrix => "Thargoid Barnacle Matrix",

                #[cfg(feature = "allow-unknown")]
                Species::Unknown(unknown) => return write!(f, "Unknown species: {}", unknown),
            }
        )
    }
}

#[cfg(test)]
mod tests {
    use strum::IntoEnumIterator;

    use crate::modules::exobiology::Species;

    #[test]
    fn all_species_have_matching_spawn_conditions() {
        for species in Species::iter() {
            dbg!(&species);
            assert!(!species.spawn_conditions().is_empty());
        }
    }
}