queries dies

This commit is contained in:
Chris Forbes
2011-03-17 22:05:53 +13:00
parent caa52b2780
commit a3994df925
34 changed files with 52 additions and 66 deletions

View File

@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA
[Sync] bool QueueActive = false;
public override void Tick( Actor self )
{
QueueActive = self.World.Queries.WithTrait<Production>()
QueueActive = self.World.ActorsWithTrait<Production>()
.Where(x => x.Actor.Owner == self.Owner)
.Where(x => x.Trait.Info.Produces.Contains(Info.Type))
.Any();
@@ -50,8 +50,8 @@ namespace OpenRA.Mods.RA
protected override bool BuildUnit( string name )
{
// Find a production structure to build this actor
var producers = self.World.Queries
.WithTrait<Production>()
var producers = self.World
.ActorsWithTrait<Production>()
.Where(x => x.Actor.Owner == self.Owner)
.Where(x => x.Trait.Info.Produces.Contains(Info.Type))
.OrderByDescending(x => x.Actor.IsPrimaryBuilding() ? 1 : 0 ); // prioritize the primary.