Rules.Categories

This commit is contained in:
Bob
2009-10-30 05:43:21 +13:00
parent 179d071a97
commit accb391c6c
6 changed files with 33 additions and 17 deletions

View File

@@ -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")