Rules.Categories
This commit is contained in:
@@ -4,6 +4,7 @@ using System.Linq;
|
||||
using OpenRa.FileFormats;
|
||||
using OpenRa.Game.GameRules;
|
||||
using IjwFramework.Types;
|
||||
using OpenRa.Game;
|
||||
|
||||
namespace OpenRa.TechTree
|
||||
{
|
||||
@@ -49,11 +50,10 @@ namespace OpenRa.TechTree
|
||||
if (soviet.Remove("tent")) soviet.Add("barr");
|
||||
if (allied.Remove("barr")) allied.Add("tent");
|
||||
|
||||
// TODO: rewrite this based on "InfantryTypes" in units.ini
|
||||
if ((tag.Length == 2 && tag[0] == 'e') || tag == "medi" || tag == "thf" || tag == "spy")
|
||||
if( Rules.Categories[ "InfantryTypes" ].Contains( tag ) )
|
||||
{
|
||||
if (!allied.Contains("tent")) allied.Add("tent");
|
||||
if (!soviet.Contains("barr")) soviet.Add("barr");
|
||||
if( !allied.Contains( "tent" ) ) allied.Add( "tent" );
|
||||
if( !soviet.Contains( "barr" ) ) soviet.Add( "barr" );
|
||||
}
|
||||
|
||||
if (tag == "lst")
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRa.TechTree
|
||||
|
||||
void LoadRules()
|
||||
{
|
||||
var allBuildings = Rules.AllRules.GetSection( "BuildingTypes" ).Select( x => x.Key.ToLowerInvariant() ).ToList();
|
||||
var allBuildings = Rules.Categories["BuildingTypes"];
|
||||
|
||||
foreach( var unit in Rules.UnitInfo )
|
||||
objects.Add( unit.Key, new Item( unit.Key, unit.Value, allBuildings.Contains( unit.Key ) ) );
|
||||
|
||||
Reference in New Issue
Block a user