Add ITerrainInfoNotifyMapCreated interface.

This commit is contained in:
Paul Chote
2020-10-11 13:31:41 +01:00
committed by reaperrr
parent 87790069e9
commit be2ca77acf
4 changed files with 29 additions and 30 deletions

View File

@@ -1020,33 +1020,6 @@ namespace OpenRA
ProjectedCells = new ProjectedCellRegion(this, tl, br).ToArray();
}
public void FixOpenAreas()
{
var r = new Random();
var tileset = Rules.TileSet;
for (var j = Bounds.Top; j < Bounds.Bottom; j++)
{
for (var i = Bounds.Left; i < Bounds.Right; i++)
{
var type = Tiles[new MPos(i, j)].Type;
var index = Tiles[new MPos(i, j)].Index;
if (!tileset.Templates.ContainsKey(type))
{
Console.WriteLine("Unknown Tile ID {0}".F(type));
continue;
}
var template = tileset.Templates[type];
if (!template.PickAny)
continue;
index = (byte)r.Next(0, template.TilesCount);
Tiles[new MPos(i, j)] = new TerrainTile(type, index);
}
}
}
public byte GetTerrainIndex(CPos cell)
{
const short InvalidCachedTerrainIndex = -1;