Avoid allocations when generating RadarSignatureCells.

The RadarWidget can supply a reusable buffer to each trait to avoid individual traits having to return new enumerables. Additionally, this allows the two traits to avoid LINQ and further allocations as they can manually enumerate and populate the buffer themselves.
This commit is contained in:
RoosterDragon
2017-11-23 19:00:28 +00:00
committed by abcdefg30
parent c69df4eedf
commit 0899d02377
4 changed files with 17 additions and 17 deletions

View File

@@ -354,7 +354,7 @@ namespace OpenRA.Mods.Common.Traits
public interface IRadarSignature
{
IEnumerable<Pair<CPos, Color>> RadarSignatureCells(Actor self);
void PopulateRadarSignatureCells(Actor self, List<Pair<CPos, Color>> destinationBuffer);
}
public interface IRadarColorModifier { Color RadarColorOverride(Actor self, Color color); }