Change terrain type from string based dictionaries to arrays

This commit is contained in:
Pavlos Touboulidis
2014-05-25 15:46:36 +03:00
parent b8cdb224d1
commit 092352729f
23 changed files with 265 additions and 137 deletions

View File

@@ -94,11 +94,11 @@ namespace OpenRA.Mods.RA
self.World.Map.CustomTerrain[c.X, c.Y] = GetTerrainType(c);
}
string GetTerrainType(CPos cell)
int GetTerrainType(CPos cell)
{
var dx = cell - self.Location;
var index = dx.X + self.World.TileSet.Templates[template].Size.X * dx.Y;
return self.World.TileSet.GetTerrainType(new TileReference<ushort, byte>(template, (byte)index));
return self.World.TileSet.GetTerrainIndex(new TileReference<ushort, byte>(template, (byte)index));
}
public void LinkNeighbouringBridges(World world, BridgeLayer bridges)