tile perf improvements

This commit is contained in:
Evan
2025-01-10 14:38:28 -08:00
parent 5fca2f287b
commit 818fbbdcd5
3 changed files with 22 additions and 6 deletions
+7 -1
View File
@@ -149,7 +149,13 @@ export class TerritoryLayer implements Layer {
}
}
paintTerritory(tile: Tile) {
paintTerritory(tile: Tile, isBorder: boolean = false, parent: Tile = null) {
if (isBorder && !tile.hasOwner()) {
return
}
if (!isBorder) {
tile.neighbors().forEach(t => this.paintTerritory(t, true, tile))
}
if (!tile.hasOwner()) {
if (tile.hasFallout()) {
this.paintCell(tile.cell(), this.theme.falloutColor(), 150)