git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1133 993157c7-ee19-0410-b2c4-bb4e9862e678

This commit is contained in:
chrisf
2007-07-07 06:22:10 +00:00
parent aa29971bf9
commit a8ea8d624a
2 changed files with 10 additions and 1 deletions

View File

@@ -46,6 +46,12 @@ namespace OpenRa.TechTreeTest
public bool ShouldMakeBuildable(IEnumerable<string> buildings)
{
if (techLevel > 10 || techLevel < 0)
return false;
if (prerequisites.Length == 0)
return true;
List<string> p = new List<string>(prerequisites);
foreach (string b in buildings)
p.Remove(b);
@@ -55,6 +61,9 @@ namespace OpenRa.TechTreeTest
public bool ShouldMakeUnbuildable(IEnumerable<string> buildings)
{
if (prerequisites.Length == 0)
return false;
List<string> p = new List<string>(prerequisites);
foreach (string b in buildings)
p.Remove(b);

View File

@@ -29,7 +29,7 @@ namespace OpenRa.TechTreeTest
IniSection section = rulesFile.GetSection(key);
Building b = buildings[key];
string s = section.GetValue("Prerequisite", "").ToUpper();
b.Prerequisites = s.Split(',');
b.Prerequisites = s.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
b.TechLevel = int.Parse(section.GetValue("TechLevel", "-1"));
}
}