CnC_Remastered_Collection

Command and Conquer: Red Alert
Log | Files | Refs | README | LICENSE

InfantryTypes.cs (4435B)


      1 //
      2 // Copyright 2020 Electronic Arts Inc.
      3 //
      4 // The Command & Conquer Map Editor and corresponding source code is free 
      5 // software: you can redistribute it and/or modify it under the terms of 
      6 // the GNU General Public License as published by the Free Software Foundation, 
      7 // either version 3 of the License, or (at your option) any later version.
      8 
      9 // The Command & Conquer Map Editor and corresponding source code is distributed 
     10 // in the hope that it will be useful, but with permitted additional restrictions 
     11 // under Section 7 of the GPL. See the GNU General Public License in LICENSE.TXT 
     12 // distributed with this program. You should have received a copy of the 
     13 // GNU General Public License along with permitted additional restrictions 
     14 // with this program. If not, see https://github.com/electronicarts/CnC_Remastered_Collection
     15 using MobiusEditor.Model;
     16 using System.Collections.Generic;
     17 using System.Linq;
     18 using System.Reflection;
     19 
     20 namespace MobiusEditor.RedAlert
     21 {
     22     public static class InfantryTypes
     23     {
     24         public static readonly InfantryType E1 = new InfantryType(0, "e1", "TEXT_UNIT_RA_E1", "Greece");
     25         public static readonly InfantryType E2 = new InfantryType(1, "e2", "TEXT_UNIT_RA_E2", "USSR");
     26         public static readonly InfantryType E3 = new InfantryType(2, "e3", "TEXT_UNIT_RA_E3", "Greece");
     27         public static readonly InfantryType E4 = new InfantryType(3, "e4", "TEXT_UNIT_RA_E4", "USSR");
     28         public static readonly InfantryType E6 = new InfantryType(4, "e6", "TEXT_UNIT_RA_E6", "USSR");
     29         public static readonly InfantryType E7 = new InfantryType(5, "e7", "TEXT_UNIT_RA_E7", "USSR");
     30         public static readonly InfantryType E8 = new InfantryType(6, "spy", "TEXT_UNIT_RA_SPY", "Greece");
     31         public static readonly InfantryType E9 = new InfantryType(7, "thf", "TEXT_UNIT_RA_THF", "Greece");
     32         public static readonly InfantryType Medic = new InfantryType(8, "medi", "TEXT_UNIT_RA_MEDI", "Greece");
     33         public static readonly InfantryType General = new InfantryType(9, "gnrl", "TEXT_UNIT_RA_GNRL", "Greece");
     34         public static readonly InfantryType Dog = new InfantryType(10, "dog", "TEXT_UNIT_RA_DOG", "USSR");
     35         public static readonly InfantryType C1 = new InfantryType(11, "c1", "TEXT_UNIT_TITLE_CIV1", "Neutral");
     36         public static readonly InfantryType C2 = new InfantryType(12, "c2", "TEXT_UNIT_TITLE_CIV2", "Neutral");
     37         public static readonly InfantryType C3 = new InfantryType(13, "c3", "TEXT_UNIT_TITLE_CIV3", "Neutral");
     38         public static readonly InfantryType C4 = new InfantryType(14, "c4", "TEXT_UNIT_TITLE_CIV4", "Neutral");
     39         public static readonly InfantryType C5 = new InfantryType(15, "c5", "TEXT_UNIT_TITLE_CIV5", "Neutral");
     40         public static readonly InfantryType C6 = new InfantryType(16, "c6", "TEXT_UNIT_TITLE_CIV6", "Neutral");
     41         public static readonly InfantryType C7 = new InfantryType(17, "c7", "TEXT_UNIT_TITLE_CIV7", "Neutral");
     42         public static readonly InfantryType C8 = new InfantryType(18, "c8", "TEXT_UNIT_TITLE_CIV8", "Neutral");
     43         public static readonly InfantryType C9 = new InfantryType(19, "c9", "TEXT_UNIT_TITLE_CIV9", "Neutral");
     44         public static readonly InfantryType C10 = new InfantryType(20, "c10", "TEXT_UNIT_RA_SCIENTIST", "Neutral");
     45         public static readonly InfantryType Einstein = new InfantryType(21, "einstein", "TEXT_UNIT_RA_EINSTEIN", "Neutral");
     46         public static readonly InfantryType Delphi = new InfantryType(22, "delphi", "TEXT_UNIT_RA_DELPHI", "Neutral");
     47         public static readonly InfantryType DrChan = new InfantryType(23, "chan", "TEXT_UNIT_TITLE_CHAN", "Neutral");
     48         public static readonly InfantryType ShockTrooper = new InfantryType(24, "shok", "TEXT_UNIT_RA_SHOK", "USSR");
     49         public static readonly InfantryType Mechanic = new InfantryType(25, "mech", "TEXT_UNIT_RA_MECH", "Greece");
     50 
     51         private static readonly InfantryType[] Types;
     52 
     53         static InfantryTypes()
     54         {
     55             Types =
     56                 (from field in typeof(InfantryTypes).GetFields(BindingFlags.Static | BindingFlags.Public)
     57                  where field.IsInitOnly && typeof(InfantryType).IsAssignableFrom(field.FieldType)
     58                  select field.GetValue(null) as InfantryType).ToArray();
     59         }
     60 
     61         public static IEnumerable<InfantryType> GetTypes()
     62         {
     63             return Types;
     64         }
     65     }
     66 }