remove most of the crap from queries

This commit is contained in:
Chris Forbes
2011-03-17 21:48:50 +13:00
parent eba7641125
commit 149324ea92
21 changed files with 113 additions and 129 deletions

View File

@@ -132,7 +132,8 @@ namespace OpenRA.Traits
{
var eva = self.World.WorldActor.Info.Traits.Get<EvaAlertsInfo>();
OreCapacity = self.World.Queries.OwnedBy[Owner].WithTrait<IStoreOre>()
OreCapacity = self.World.Queries.WithTrait<IStoreOre>()
.Where(a => a.Actor.Owner == Owner)
.Sum(a => a.Trait.Capacity);
if (Ore > OreCapacity)

View File

@@ -126,7 +126,7 @@ namespace OpenRA.Traits
}
// Is now our ally; add unit vis
if (newStance == Stance.Ally)
foreach (var a in w.Queries.OwnedBy[player])
foreach (var a in w.Actors.Where( a => a.Owner == player ))
AddActor(a);
}