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

This commit is contained in:
beedee
2007-07-13 14:08:20 +00:00
parent 37b0d0cb57
commit bcafc89002
4 changed files with 80 additions and 3 deletions

View File

@@ -12,11 +12,20 @@ namespace OpenRa.TechTree
Dictionary<string, Item> objects = new Dictionary<string, Item>();
public ICollection<string> built = new List<string>();
readonly Race currentRace;
Race currentRace = Race.None;
public TechTree(Race race)
public Race CurrentRace
{
get { return currentRace; }
set
{
currentRace = value;
CheckAll();
}
}
public TechTree()
{
this.currentRace = race;
LoadRules();
built.Add("FACT");
@@ -89,5 +98,25 @@ namespace OpenRa.TechTree
yield return b;
}
}
public IEnumerable<Item> BuildableBuildings
{
get
{
foreach (Item i in BuildableItems)
if (i.IsStructure)
yield return i;
}
}
public IEnumerable<Item> BuildableUnits
{
get
{
foreach (Item i in BuildableItems)
if (!i.IsStructure)
yield return i;
}
}
}
}