InfantryTypes.cs (3888B)
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.TiberianDawn 21 { 22 public static class InfantryTypes 23 { 24 public static readonly InfantryType E1 = new InfantryType(0, "e1", "TEXT_UNIT_TITLE_GDI_MINIGUNNER", "Goodguy"); 25 public static readonly InfantryType E2 = new InfantryType(1, "e2", "TEXT_UNIT_TITLE_GDI_GRENADIER", "Goodguy"); 26 public static readonly InfantryType E3 = new InfantryType(2, "e3", "TEXT_UNIT_TITLE_GDI_ROCKET_SOLDIER", "Badguy"); 27 public static readonly InfantryType E4 = new InfantryType(3, "e4", "TEXT_UNIT_TITLE_NOD_FLAMETHROWER", "Badguy"); 28 public static readonly InfantryType E5 = new InfantryType(4, "e5", "TEXT_UNIT_TITLE_NOD_CHEM_WARRIOR", "Badguy"); 29 public static readonly InfantryType E7 = new InfantryType(5, "e6", "TEXT_UNIT_TITLE_GDI_ENGINEER", "Goodguy"); 30 public static readonly InfantryType Commando = new InfantryType(6, "rmbo", "TEXT_UNIT_TITLE_GDI_COMMANDO", "Goodguy"); 31 public static readonly InfantryType C1 = new InfantryType(7, "c1", "TEXT_UNIT_TITLE_CIV1", "Neutral"); 32 public static readonly InfantryType C2 = new InfantryType(8, "c2", "TEXT_UNIT_TITLE_CIV2", "Neutral"); 33 public static readonly InfantryType C3 = new InfantryType(9, "c3", "TEXT_UNIT_TITLE_CIV3", "Neutral"); 34 public static readonly InfantryType C4 = new InfantryType(10, "c4", "TEXT_UNIT_TITLE_CIV4", "Neutral"); 35 public static readonly InfantryType C5 = new InfantryType(11, "c5", "TEXT_UNIT_TITLE_CIV5", "Neutral"); 36 public static readonly InfantryType C6 = new InfantryType(12, "c6", "TEXT_UNIT_TITLE_CIV6", "Neutral"); 37 public static readonly InfantryType C7 = new InfantryType(13, "c7", "TEXT_UNIT_TITLE_CIV7", "Neutral"); 38 public static readonly InfantryType C8 = new InfantryType(14, "c8", "TEXT_UNIT_TITLE_CIV8", "Neutral"); 39 public static readonly InfantryType C9 = new InfantryType(15, "c9", "TEXT_UNIT_TITLE_CIV9", "Neutral"); 40 public static readonly InfantryType C10 = new InfantryType(16, "c10", "TEXT_UNIT_TITLE_C10", "Neutral"); 41 public static readonly InfantryType Moebius = new InfantryType(17, "moebius", "TEXT_UNIT_TITLE_MOEBIUS", "Neutral"); 42 public static readonly InfantryType Delphi = new InfantryType(18, "delphi", "TEXT_UNIT_TITLE_DELPHI", "Neutral"); 43 public static readonly InfantryType DrChan = new InfantryType(19, "chan", "TEXT_UNIT_TITLE_CHAN", "Neutral"); 44 45 private static readonly InfantryType[] Types; 46 47 static InfantryTypes() 48 { 49 Types = 50 (from field in typeof(InfantryTypes).GetFields(BindingFlags.Static | BindingFlags.Public) 51 where field.IsInitOnly && typeof(InfantryType).IsAssignableFrom(field.FieldType) 52 select field.GetValue(null) as InfantryType).ToArray(); 53 } 54 55 public static IEnumerable<InfantryType> GetTypes() 56 { 57 return Types; 58 } 59 } 60 }