CnC_Remastered_Collection

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

SmudgeTypes.cs (2829B)


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