StyleCop
This commit is contained in:
@@ -10,12 +10,21 @@
|
|||||||
|
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Mods.RA.Orders;
|
|
||||||
using OpenRA.FileFormats;
|
using OpenRA.FileFormats;
|
||||||
|
using OpenRA.Mods.RA.Orders;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
static class PrimaryExts
|
||||||
|
{
|
||||||
|
public static bool IsPrimaryBuilding(this Actor a)
|
||||||
|
{
|
||||||
|
var pb = a.TraitOrDefault<PrimaryBuilding>();
|
||||||
|
return pb != null && pb.IsPrimary;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[Desc("Used together with ClassicProductionQueue.")]
|
[Desc("Used together with ClassicProductionQueue.")]
|
||||||
class PrimaryBuildingInfo : TraitInfo<PrimaryBuilding> { }
|
class PrimaryBuildingInfo : TraitInfo<PrimaryBuilding> { }
|
||||||
|
|
||||||
@@ -26,7 +35,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
public IEnumerable<TagType> GetTags()
|
public IEnumerable<TagType> GetTags()
|
||||||
{
|
{
|
||||||
yield return (isPrimary) ? TagType.Primary : TagType.None;
|
yield return isPrimary ? TagType.Primary : TagType.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IOrderTargeter> Orders
|
public IEnumerable<IOrderTargeter> Orders
|
||||||
@@ -63,7 +72,7 @@ namespace OpenRA.Mods.RA
|
|||||||
.ActorsWithTrait<PrimaryBuilding>()
|
.ActorsWithTrait<PrimaryBuilding>()
|
||||||
.Where(a => a.Actor.Owner == self.Owner)
|
.Where(a => a.Actor.Owner == self.Owner)
|
||||||
.Where(x => x.Trait.IsPrimary
|
.Where(x => x.Trait.IsPrimary
|
||||||
&& (x.Actor.Info.Traits.Get<ProductionInfo>().Produces.Contains(p))))
|
&& x.Actor.Info.Traits.Get<ProductionInfo>().Produces.Contains(p)))
|
||||||
b.Trait.SetPrimaryProducer(b.Actor, false);
|
b.Trait.SetPrimaryProducer(b.Actor, false);
|
||||||
|
|
||||||
isPrimary = true;
|
isPrimary = true;
|
||||||
@@ -71,13 +80,4 @@ namespace OpenRA.Mods.RA
|
|||||||
Sound.PlayNotification(self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Country.Race);
|
Sound.PlayNotification(self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Country.Race);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static class PrimaryExts
|
|
||||||
{
|
|
||||||
public static bool IsPrimaryBuilding(this Actor a)
|
|
||||||
{
|
|
||||||
var pb = a.TraitOrDefault<PrimaryBuilding>();
|
|
||||||
return pb != null && pb.IsPrimary;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user