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