Use enum-based objectives for Allies 01

This commit is contained in:
Scott_NZ
2012-09-19 02:05:49 +12:00
parent 68d0201538
commit 67c40f3119
3 changed files with 71 additions and 36 deletions

View File

@@ -16,6 +16,7 @@ using OpenRA.Mods.RA.Activities;
using OpenRA.Mods.RA.Air;
using OpenRA.Mods.RA.Buildings;
using OpenRA.Traits;
using System.Drawing;
namespace OpenRA.Mods.RA.Missions
{
@@ -79,5 +80,12 @@ namespace OpenRA.Mods.RA.Missions
.OrderBy(a => (location - a.CenterLocation).LengthSquared)
.FirstOrDefault();
}
public static IEnumerable<ProductionQueue> FindQueues(World world, Player player, string category)
{
return world.ActorsWithTrait<ProductionQueue>()
.Where(a => a.Actor.Owner == player && a.Trait.Info.Type == category)
.Select(a => a.Trait);
}
}
}