CnC_Remastered_Collection

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

BuildingTypes.cs (14014B)


      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 BuildingTypes
     24     {
     25         public static readonly BuildingType Weapon = new BuildingType(0, "weap", "TEXT_STRUCTURE_TITLE_GDI_WEAPONS_FACTORY", new bool[3, 3] { { false, false, false }, { true, true, true }, { true, true, true } }, true, "Goodguy", false, false, "weap2");
     26         public static readonly BuildingType GTower = new BuildingType(1, "gtwr", "TEXT_STRUCTURE_TITLE_GDI_GUARD_TOWER", new bool[1, 1] { { true } }, false, "Goodguy");
     27         public static readonly BuildingType ATower = new BuildingType(2, "atwr", "TEXT_STRUCTURE_TITLE_GDI_ADV_GUARD_TOWER", new bool[2, 1] { { false }, { true } }, false, "Goodguy");
     28         public static readonly BuildingType Obelisk = new BuildingType(3, "obli", "TEXT_STRUCTURE_TITLE_NOD_OBELISK", new bool[2, 1] { { false }, { true } }, false, "Badguy");
     29         public static readonly BuildingType Command = new BuildingType(4, "hq", "TEXT_STRUCTURE_TITLE_GDI_COMM_CENTER", new bool[2, 2] { { true, false }, { true, true } }, true, "Goodguy");
     30         public static readonly BuildingType Turret = new BuildingType(5, "gun", "TEXT_STRUCTURE_TITLE_NOD_TURRET", new bool[1, 1] { { true } }, false, "Badguy", false, true);
     31         public static readonly BuildingType Const = new BuildingType(6, "fact", "TEXT_STRUCTURE_RA_FACT", new bool[2, 3] { { true, true, true }, { true, true, true } }, true, "Goodguy");
     32         public static readonly BuildingType Refinery = new BuildingType(7, "proc", "TEXT_STRUCTURE_TITLE_GDI_REFINERY", new bool[3, 3] { { false, true, false }, { true, true, true }, { false, false, false } }, true, "Goodguy");
     33         public static readonly BuildingType Storage = new BuildingType(8, "silo", "TEXT_STRUCTURE_TITLE_GDI_SILO", new bool[1, 2] { { true, true } }, true, "Goodguy");
     34         public static readonly BuildingType Helipad = new BuildingType(9, "hpad", "TEXT_STRUCTURE_TITLE_GDI_HELIPAD", new bool[2, 2] { { true, true }, { true, true } }, true, "Goodguy");
     35         public static readonly BuildingType SAM = new BuildingType(10, "sam", "TEXT_STRUCTURE_TITLE_NOD_SAM_SITE", new bool[1, 2] { { true, true } }, false, "Badguy");
     36         public static readonly BuildingType AirStrip = new BuildingType(11, "afld", "TEXT_STRUCTURE_TITLE_NOD_AIRFIELD", new bool[2, 4] { { true, true, true, true }, { true, true, true, true } }, true, "Badguy");
     37         public static readonly BuildingType Power = new BuildingType(12, "nuke", "TEXT_STRUCTURE_TITLE_GDI_POWER_PLANT", new bool[2, 2] { { true, false }, { true, true } }, true, "Goodguy");
     38         public static readonly BuildingType AdvancedPower = new BuildingType(13, "nuk2", "TEXT_STRUCTURE_TITLE_GDI_ADV_POWER_PLANT", new bool[2, 2] { { true, false }, { true, true } }, true, "Goodguy");
     39         public static readonly BuildingType Hospital = new BuildingType(14, "hosp", "TEXT_UNIT_TITLE_HOSP", new bool[2, 2] { { true, true }, { true, true } }, true, "Goodguy");
     40         public static readonly BuildingType Barracks = new BuildingType(15, "pyle", "TEXT_STRUCTURE_TITLE_GDI_BARRACKS", new bool[2, 2] { { true, true }, { false, false } }, true, "Goodguy");
     41         public static readonly BuildingType Tanker = new BuildingType(16, "arco", "TEXT_UNIT_TITLE_ARCO", new bool[1, 2] { { true, true } }, false, "Goodguy");
     42         public static readonly BuildingType Repair = new BuildingType(17, "fix", "TEXT_STRUCTURE_TITLE_GDI_REPAIR_FACILITY", new bool[3, 3] { { false, true, false }, { true, true, true }, { false, true, false} }, true, "Goodguy");
     43         public static readonly BuildingType BioLab = new BuildingType(18, "bio", "TEXT_UNIT_TITLE_BIO", new bool[2, 2] { { true, true }, { true, true } }, true, "Goodguy");
     44         public static readonly BuildingType Hand = new BuildingType(19, "hand", "TEXT_STRUCTURE_TITLE_NOD_HAND_OF_NOD", new bool[3, 2] { { false, false }, { true, true }, { false, true } }, true, "Badguy");
     45         public static readonly BuildingType Temple = new BuildingType(20, "tmpl", "TEXT_STRUCTURE_TITLE_NOD_TEMPLE_OF_NOD", new bool[3, 3] { { false, false, false }, { true, true, true }, { true, true, true } }, true, "Badguy");
     46         public static readonly BuildingType Eye = new BuildingType(21, "eye", "TEXT_STRUCTURE_TITLE_GDI_ADV_COMM_CENTER", new bool[2, 2] { { true, false }, { true, true } }, true, "Goodguy");
     47         public static readonly BuildingType Mission = new BuildingType(22, "miss", "TEXT_STRUCTURE_TITLE_CIV35", new bool[2, 3] { { true, true, true }, { true, true, true } }, true, "Goodguy");
     48         public static readonly BuildingType V01 = new BuildingType(23, "v01", "TEXT_STRUCTURE_TITLE_CIV1", new bool[2, 2] { { false, false }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     49         public static readonly BuildingType V02 = new BuildingType(24, "v02", "TEXT_STRUCTURE_TITLE_CIV2", new bool[2, 2] { { false, false }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     50         public static readonly BuildingType V03 = new BuildingType(25, "v03", "TEXT_STRUCTURE_TITLE_CIV3", new bool[2, 2] { { false, true }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     51         public static readonly BuildingType V04 = new BuildingType(26, "v04", "TEXT_STRUCTURE_TITLE_CIV4", new bool[2, 2] { { false, false }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     52         public static readonly BuildingType V05 = new BuildingType(27, "v05", "TEXT_STRUCTURE_TITLE_CIV5", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     53         public static readonly BuildingType V06 = new BuildingType(28, "v06", "TEXT_STRUCTURE_TITLE_CIV6", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     54         public static readonly BuildingType V07 = new BuildingType(29, "v07", "TEXT_STRUCTURE_TITLE_CIV7", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     55         public static readonly BuildingType V08 = new BuildingType(30, "v08", "TEXT_STRUCTURE_TITLE_CIV8", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     56         public static readonly BuildingType V09 = new BuildingType(31, "v09", "TEXT_STRUCTURE_TITLE_CIV9", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     57         public static readonly BuildingType V10 = new BuildingType(32, "v10", "TEXT_STRUCTURE_TITLE_CIV10", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     58         public static readonly BuildingType V11 = new BuildingType(33, "v11", "TEXT_STRUCTURE_TITLE_CIV11", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     59         public static readonly BuildingType V12 = new BuildingType(34, "v12", "TEXT_STRUCTURE_TITLE_CIV12", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate });
     60         public static readonly BuildingType V13 = new BuildingType(35, "v13", "TEXT_STRUCTURE_TITLE_CIV12", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate });
     61         public static readonly BuildingType V14 = new BuildingType(36, "v14", "TEXT_STRUCTURE_TITLE_CIV13", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     62         public static readonly BuildingType V15 = new BuildingType(37, "v15", "TEXT_STRUCTURE_TITLE_CIV14", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     63         public static readonly BuildingType V16 = new BuildingType(38, "v16", "TEXT_STRUCTURE_TITLE_CIV15", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     64         public static readonly BuildingType V17 = new BuildingType(39, "v17", "TEXT_STRUCTURE_TITLE_CIV16", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     65         public static readonly BuildingType V18 = new BuildingType(40, "v18", "TEXT_STRUCTURE_TITLE_CIV17", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Temperate, TheaterTypes.Winter });
     66         public static readonly BuildingType V19 = new BuildingType(41, "v19", "TEXT_STRUCTURE_CIVILIAN_TITLE", new bool[1, 1] { { true } }, false, "Neutral");
     67         public static readonly BuildingType V20 = new BuildingType(42, "v20", "TEXT_STRUCTURE_TITLE_CIV18", new bool[2, 2] { { false, false }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     68         public static readonly BuildingType V21 = new BuildingType(43, "v21", "TEXT_STRUCTURE_TITLE_CIV19", new bool[2, 2] { { true, true }, { false, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     69         public static readonly BuildingType V22 = new BuildingType(44, "v22", "TEXT_STRUCTURE_TITLE_CIV20", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     70         public static readonly BuildingType V23 = new BuildingType(45, "v23", "TEXT_STRUCTURE_TITLE_CIV21", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     71         public static readonly BuildingType V24 = new BuildingType(46, "v24", "TEXT_STRUCTURE_TITLE_CIV22", new bool[2, 2] { { false, false }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     72         public static readonly BuildingType V25 = new BuildingType(47, "v25", "TEXT_STRUCTURE_TITLE_CIV1", new bool[2, 2] { { false, true }, { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     73         public static readonly BuildingType V26 = new BuildingType(48, "v26", "TEXT_STRUCTURE_TITLE_CIV23", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     74         public static readonly BuildingType V27 = new BuildingType(49, "v27", "TEXT_STRUCTURE_TITLE_CIV24", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     75         public static readonly BuildingType V28 = new BuildingType(50, "v28", "TEXT_STRUCTURE_TITLE_CIV25", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     76         public static readonly BuildingType V29 = new BuildingType(51, "v29", "TEXT_STRUCTURE_TITLE_CIV26", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     77         public static readonly BuildingType V30 = new BuildingType(52, "v30", "TEXT_STRUCTURE_TITLE_CIV27", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     78         public static readonly BuildingType V31 = new BuildingType(53, "v31", "TEXT_STRUCTURE_TITLE_CIV28", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     79         public static readonly BuildingType V32 = new BuildingType(54, "v32", "TEXT_STRUCTURE_TITLE_CIV29", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     80         public static readonly BuildingType V33 = new BuildingType(55, "v33", "TEXT_STRUCTURE_TITLE_CIV30", new bool[1, 2] { { true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     81         public static readonly BuildingType V34 = new BuildingType(56, "v34", "TEXT_STRUCTURE_TITLE_CIV31", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     82         public static readonly BuildingType V35 = new BuildingType(57, "v35", "TEXT_STRUCTURE_TITLE_CIV32", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     83         public static readonly BuildingType V36 = new BuildingType(58, "v36", "TEXT_STRUCTURE_TITLE_CIV33", new bool[1, 1] { { true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     84         public static readonly BuildingType V37 = new BuildingType(59, "v37", "TEXT_STRUCTURE_TITLE_CIV34", new bool[2, 4] { { false, true, true, true }, { false, true, true, true } }, false, "Neutral", new TheaterType[] { TheaterTypes.Desert });
     85 
     86         private static readonly BuildingType[] Types;
     87 
     88         static BuildingTypes()
     89         {
     90             Types =
     91                 (from field in typeof(BuildingTypes).GetFields(BindingFlags.Static | BindingFlags.Public)
     92                  where field.IsInitOnly && typeof(BuildingType).IsAssignableFrom(field.FieldType)
     93                  select field.GetValue(null) as BuildingType).ToArray();
     94         }
     95 
     96         public static IEnumerable<BuildingType> GetTypes()
     97         {
     98             return Types;
     99         }
    100     }
    101 }