First attempt; works, but has regressions in several areas

This commit is contained in:
Paul Chote
2010-05-23 17:27:40 +12:00
parent b8b3ef61aa
commit d9931af5ae
8 changed files with 131 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -26,6 +26,9 @@ namespace OpenRA.Traits
public void Tick( Player owner, Cache<string, List<Actor>> buildings )
{
// HACK
return;
var effectivePrereq = prerequisites.Where( a => a.Traits.Get<BuildableInfo>().Owner.Contains( owner.Country.Race ) );
var nowHasPrerequisites = effectivePrereq.Any() &&
effectivePrereq.All( a => buildings[ a.Name ].Any( b => !b.traits.Get<Building>().Disabled ) );