Skip to content

Commit

Permalink
Converts some IEnumerables to array.
Browse files Browse the repository at this point in the history
  • Loading branch information
deniz1a committed Apr 28, 2015
1 parent ece7e63 commit 1ec2d89
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions OpenRA.Game/Traits/Player/FrozenActorLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class FrozenActorLayerInfo : ITraitInfo
public class FrozenActor
{
public readonly MPos[] Footprint;
public readonly IEnumerable<CPos> OccCells;
public readonly CPos[] OccCells;
public readonly WPos CenterPosition;
public readonly Rectangle Bounds;
readonly Actor actor;
Expand All @@ -51,7 +51,7 @@ public FrozenActor(Actor self, MPos[] footprint, CellRegion footprintRegion, Shr
isVisibleTest = shroud.IsVisibleTest(footprintRegion);

Footprint = footprint;
OccCells = Shroud.GetVisOrigins(actor);
OccCells = Shroud.GetVisOrigins(actor).ToArray();
CenterPosition = self.CenterPosition;
Bounds = self.Bounds;

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Game/Traits/World/Shroud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public bool IsUnderDisruptionField(MPos[] fp)
return fp.All(c => generatedDisruptionCount[c] > 0);
}

public bool IsUnderDisruptionField(IEnumerable<CPos> fp)
public bool IsUnderDisruptionField(CPos[] fp)
{
return fp.All(c => generatedDisruptionCount[c] > 0);
}
Expand Down
3 changes: 2 additions & 1 deletion OpenRA.Mods.RA/Effects/GpsDot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.Effects;
using OpenRA.Graphics;
using OpenRA.Mods.Common.Traits;
Expand Down Expand Up @@ -71,7 +72,7 @@ bool ShouldShowIndicator()
if (disguise.Value != null && disguise.Value.Disguised)
return false;

if (self.World.RenderPlayer.Shroud.IsUnderDisruptionField(Shroud.GetVisOrigins(self)))
if (self.World.RenderPlayer.Shroud.IsUnderDisruptionField(Shroud.GetVisOrigins(self).ToArray()))
return false;

if (huf.Value != null && !huf.Value.IsVisible(self, self.World.RenderPlayer))
Expand Down

0 comments on commit 1ec2d89

Please sign in to comment.