mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:00:44 +00:00
simplify tile rendering
This commit is contained in:
@@ -146,16 +146,14 @@ export class TerritoryLayer implements Layer {
|
||||
numToRender--
|
||||
const tile = this.tileToRenderQueue.pop().tile
|
||||
this.paintTerritory(tile)
|
||||
tile.neighbors().forEach(t => this.paintTerritory(t, true))
|
||||
}
|
||||
}
|
||||
|
||||
paintTerritory(tile: Tile, isBorder: boolean = false, parent: Tile = null) {
|
||||
paintTerritory(tile: Tile, isBorder: boolean = false) {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user