SmudgeTypes.cs 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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.Drawing;
  17. using System.Linq;
  18. using System.Reflection;
  19. namespace MobiusEditor.RedAlert
  20. {
  21. public static class SmudgeTypes
  22. {
  23. public static readonly SmudgeType Crater1 = new SmudgeType(0, "cr1");
  24. public static readonly SmudgeType Crater2 = new SmudgeType(1, "cr2");
  25. public static readonly SmudgeType Crater3 = new SmudgeType(2, "cr3");
  26. public static readonly SmudgeType Crater4 = new SmudgeType(3, "cr4");
  27. public static readonly SmudgeType Crater5 = new SmudgeType(4, "cr5");
  28. public static readonly SmudgeType Crater6 = new SmudgeType(5, "cr6");
  29. public static readonly SmudgeType Scorch1 = new SmudgeType(6, "sc1");
  30. public static readonly SmudgeType Scorch2 = new SmudgeType(7, "sc2");
  31. public static readonly SmudgeType Scorch3 = new SmudgeType(8, "sc3");
  32. public static readonly SmudgeType Scorch4 = new SmudgeType(9, "sc4");
  33. public static readonly SmudgeType Scorch5 = new SmudgeType(10, "sc5");
  34. public static readonly SmudgeType Scorch6 = new SmudgeType(11, "sc6");
  35. public static readonly SmudgeType Bib1 = new SmudgeType(12, "bib1", new Size(4, 2), SmudgeTypeFlag.Bib1);
  36. public static readonly SmudgeType Bib2 = new SmudgeType(13, "bib2", new Size(3, 2), SmudgeTypeFlag.Bib2);
  37. public static readonly SmudgeType Bib3 = new SmudgeType(14, "bib3", new Size(2, 2), SmudgeTypeFlag.Bib3);
  38. private static SmudgeType[] Types;
  39. static SmudgeTypes()
  40. {
  41. Types =
  42. (from field in typeof(SmudgeTypes).GetFields(BindingFlags.Static | BindingFlags.Public)
  43. where field.IsInitOnly && typeof(SmudgeType).IsAssignableFrom(field.FieldType)
  44. select field.GetValue(null) as SmudgeType).ToArray();
  45. }
  46. public static IEnumerable<SmudgeType> GetTypes()
  47. {
  48. return Types;
  49. }
  50. }
  51. }