Convert some keys users of CellLayer to index via map-coords for efficiency.

This commit is contained in:
RoosterDragon
2014-12-05 20:55:18 +00:00
parent b728deb0e1
commit c37a691c33
11 changed files with 140 additions and 88 deletions

View File

@@ -332,8 +332,8 @@ namespace OpenRA.Mods.RA.Move
defaultCellInfoLayer.Shape != map.TileShape)
{
defaultCellInfoLayer = new CellLayer<CellInfo>(map);
foreach (var cell in map.Cells)
defaultCellInfoLayer[cell] = new CellInfo(int.MaxValue, cell, false);
foreach (var uv in map.Cells.MapCoords)
defaultCellInfoLayer[uv.X, uv.Y] = new CellInfo(int.MaxValue, Map.MapToCell(map.TileShape, uv), false);
}
result.CopyValuesFrom(defaultCellInfoLayer);