Remove Actor.HasTrait<T>()
This commit is contained in:
@@ -177,7 +177,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
bool PerformGuard()
|
||||
{
|
||||
var actors = world.Selection.Actors
|
||||
.Where(a => !a.Disposed && a.Owner == world.LocalPlayer && a.HasTrait<Guard>());
|
||||
.Where(a => !a.Disposed && a.Owner == world.LocalPlayer && a.Info.Traits.Contains<GuardInfo>());
|
||||
|
||||
if (actors.Any())
|
||||
world.OrderGenerator = new GuardOrderGenerator(actors);
|
||||
@@ -197,7 +197,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
{
|
||||
var building = world.ActorsWithTrait<Building>()
|
||||
.Select(b => b.Actor)
|
||||
.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.HasTrait<Selectable>());
|
||||
.FirstOrDefault(a => a.Owner == world.LocalPlayer && a.Info.Traits.Contains<SelectableInfo>());
|
||||
|
||||
// No buildings left
|
||||
if (building == null)
|
||||
@@ -223,7 +223,7 @@ namespace OpenRA.Mods.Common.Widgets
|
||||
bool CycleProductionBuildings()
|
||||
{
|
||||
var facilities = world.ActorsWithTrait<Production>()
|
||||
.Where(a => a.Actor.Owner == world.LocalPlayer && !a.Actor.HasTrait<BaseBuilding>())
|
||||
.Where(a => a.Actor.Owner == world.LocalPlayer && !a.Actor.Info.Traits.Contains<BaseBuildingInfo>())
|
||||
.OrderBy(f => f.Actor.Info.Traits.Get<ProductionInfo>().Produces.First())
|
||||
.Select(b => b.Actor)
|
||||
.ToList();
|
||||
|
||||
Reference in New Issue
Block a user