InfantryTypes.cs 4.3 KB

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