mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-01 01:23:25 +00:00
better UX for boats
This commit is contained in:
@@ -3,7 +3,7 @@ import {Cell, Game, PlayerEvent, Tile, TileEvent, Player, Execution, BoatEvent}
|
||||
import {Theme} from "../../core/configuration/Config";
|
||||
import {DragEvent, ZoomEvent} from "../InputHandler";
|
||||
import {NameRenderer} from "./NameRenderer";
|
||||
import {bfs, manhattanDist} from "../../core/Util";
|
||||
import {bfs, dist, manhattanDist} from "../../core/Util";
|
||||
import {PseudoRandom} from "../../core/PseudoRandom";
|
||||
import {TerrainRenderer} from "./TerrainRenderer";
|
||||
import {PriorityQueue} from "@datastructures-js/priority-queue";
|
||||
@@ -157,11 +157,10 @@ export class GameRenderer {
|
||||
}
|
||||
|
||||
boatEvent(event: BoatEvent) {
|
||||
bfs(event.oldTile, 2).forEach(t => this.paintTerritory(t))
|
||||
bfs(event.oldTile, dist(2)).forEach(t => this.paintTerritory(t))
|
||||
if (event.boat.isActive()) {
|
||||
bfs(event.boat.tile(), 2).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id())))
|
||||
bfs(event.boat.tile(), 1).forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.boat.owner().id())))
|
||||
|
||||
bfs(event.boat.tile(), dist(2)).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id())))
|
||||
bfs(event.boat.tile(), dist(1)).forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.boat.owner().id())))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user