OverlayTypes.cs 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 OverlayTypes
  21. {
  22. public static readonly OverlayType Sandbag = new OverlayType(0, "sbag", "TEXT_STRUCTURE_RA_SBAG", OverlayTypeFlag.Wall);
  23. public static readonly OverlayType Cyclone = new OverlayType(1, "cycl", "TEXT_STRUCTURE_RA_CYCL", OverlayTypeFlag.Wall);
  24. public static readonly OverlayType Brick = new OverlayType(2, "brik", "TEXT_STRUCTURE_RA_BRIK", OverlayTypeFlag.Wall);
  25. public static readonly OverlayType Barbwire = new OverlayType(3, "barb", "TEXT_STRUCTURE_RA_BARB", OverlayTypeFlag.Wall);
  26. public static readonly OverlayType Wood = new OverlayType(4, "wood", "TEXT_STRUCTURE_TD_WOOD", OverlayTypeFlag.Wall);
  27. public static readonly OverlayType Gold1 = new OverlayType(5, "gold01", OverlayTypeFlag.TiberiumOrGold);
  28. public static readonly OverlayType Gold2 = new OverlayType(6, "gold02", OverlayTypeFlag.TiberiumOrGold);
  29. public static readonly OverlayType Gold3 = new OverlayType(7, "gold03", OverlayTypeFlag.TiberiumOrGold);
  30. public static readonly OverlayType Gold4 = new OverlayType(8, "gold04", OverlayTypeFlag.TiberiumOrGold);
  31. public static readonly OverlayType Gems1 = new OverlayType(9, "gem01", OverlayTypeFlag.Gems);
  32. public static readonly OverlayType Gems2 = new OverlayType(10, "gem02", OverlayTypeFlag.Gems);
  33. public static readonly OverlayType Gems3 = new OverlayType(11, "gem03", OverlayTypeFlag.Gems);
  34. public static readonly OverlayType Gems4 = new OverlayType(12, "gem04", OverlayTypeFlag.Gems);
  35. public static readonly OverlayType V12 = new OverlayType(13, "v12", "TEXT_STRUCTURE_RA_CIVILIAN", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  36. public static readonly OverlayType V13 = new OverlayType(14, "v13", "TEXT_STRUCTURE_RA_CIVILIAN", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  37. public static readonly OverlayType V14 = new OverlayType(15, "v14", "TEXT_STRUCTURE_TITLE_CIV13", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  38. public static readonly OverlayType V15 = new OverlayType(16, "v15", "TEXT_STRUCTURE_TITLE_CIV14", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  39. public static readonly OverlayType V16 = new OverlayType(17, "v16", "TEXT_STRUCTURE_TITLE_CIV15", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  40. public static readonly OverlayType V17 = new OverlayType(18, "v17", "TEXT_STRUCTURE_TITLE_CIV16", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  41. public static readonly OverlayType V18 = new OverlayType(19, "v18", "TEXT_STRUCTURE_TITLE_CIV17", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Snow });
  42. public static readonly OverlayType FlagSpot = new OverlayType(20, "fpls", OverlayTypeFlag.Flag);
  43. public static readonly OverlayType WoodCrate = new OverlayType(21, "wcrate", OverlayTypeFlag.Crate);
  44. public static readonly OverlayType SteelCrate = new OverlayType(22, "scrate", OverlayTypeFlag.Crate);
  45. public static readonly OverlayType Fence = new OverlayType(23, "fenc", "TEXT_STRUCTURE_RA_FENC", OverlayTypeFlag.Wall);
  46. public static readonly OverlayType WaterCrate = new OverlayType(24, "wwcrate", OverlayTypeFlag.Crate);
  47. private static OverlayType[] Types;
  48. static OverlayTypes()
  49. {
  50. Types =
  51. (from field in typeof(OverlayTypes).GetFields(BindingFlags.Static | BindingFlags.Public)
  52. where field.IsInitOnly && typeof(OverlayType).IsAssignableFrom(field.FieldType)
  53. select field.GetValue(null) as OverlayType).ToArray();
  54. }
  55. public static IEnumerable<OverlayType> GetTypes()
  56. {
  57. return Types;
  58. }
  59. }
  60. }