Remove some misc redundancies

This commit is contained in:
ScottNZ
2013-11-12 17:40:34 +13:00
parent 8197f29606
commit 1394c1dcee
48 changed files with 104 additions and 103 deletions

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Traits
return;
var pipSources = self.TraitsImplementing<IPips>();
if (pipSources.Count() == 0)
if (!pipSources.Any())
return;
var pipImages = new Animation("pips");

View File

@@ -32,14 +32,14 @@ namespace OpenRA.Traits
public static Target FromOrder(Order o)
{
return o.TargetActor != null
? Target.FromActor(o.TargetActor)
: Target.FromCell(o.TargetLocation);
? FromActor(o.TargetActor)
: FromCell(o.TargetLocation);
}
public static Target FromActor(Actor a)
{
if (a == null)
return Target.Invalid;
return Invalid;
return new Target
{

View File

@@ -134,7 +134,7 @@ namespace OpenRA.Traits
public static IEnumerable<CPos> AdjacentCells(Target target)
{
var cells = target.Positions.Select(p => p.ToCPos()).Distinct();
return Util.ExpandFootprint(cells, true);
return ExpandFootprint(cells, true);
}
}
}