cleaning techtree & sidebar; building placement is mostly fixed

This commit is contained in:
Chris Forbes
2009-10-20 22:35:05 +13:00
parent b3aa4bf60b
commit 6c0ced3e9a
8 changed files with 121 additions and 144 deletions

View File

@@ -32,20 +32,6 @@ namespace OpenRa.TechTree
CheckAll();
}
IEnumerable<Tuple<string, string, bool>> Lines(string filename, bool param)
{
Regex pattern = new Regex(@"^(\w+),([\w ]+),(\w+)$");
foreach (string s in File.ReadAllLines("../../../../" + filename))
{
Match m = pattern.Match(s);
if (m == null || !m.Success)
continue;
yield return new Tuple<string, string, bool>(
m.Groups[1].Value, m.Groups[2].Value, param);
}
}
void LoadRules()
{
var allBuildings = Rules.AllRules.GetSection( "BuildingTypes" ).Select( x => x.Key.ToLowerInvariant() ).ToList();
@@ -63,12 +49,9 @@ namespace OpenRa.TechTree
built.Add(key);
CheckAll();
return true;
}
public bool Build(string key)
{
return Build(key, false);
}
}
public bool Build(string key) { return Build(key, false); }
public bool Unbuild(string key)
{
@@ -86,18 +69,9 @@ namespace OpenRa.TechTree
unit.CheckPrerequisites(built, currentRace);
BuildableItemsChanged();
}
public IEnumerable<Item> BuildableItems
{
get
{
foreach (Item b in objects.Values)
if (b.CanBuild)
yield return b;
}
}
}
public IEnumerable<Item> BuildableItems { get { return objects.Values.Where(b => b.CanBuild); } }
public event Action BuildableItemsChanged = () => { };
}
}