This commit is contained in:
Scott Anderson
2025-04-14 21:19:12 -04:00
parent cae16671a5
commit 48edcc6460
+5 -3
View File
@@ -154,7 +154,7 @@ export class GameMapImpl implements GameMap {
}
hasOwner(ref: TileRef): boolean {
return this.ownerID(ref) != 0;
return this.ownerID(ref) !== 0;
}
setOwnerID(ref: TileRef, playerId: number): void {
@@ -189,12 +189,14 @@ export class GameMapImpl implements GameMap {
isOnEdgeOfMap(ref: TileRef): boolean {
const x = this.x(ref);
const y = this.y(ref);
return x == 0 || x == this.width() - 1 || y == 0 || y == this.height() - 1;
return (
x === 0 || x === this.width() - 1 || y === 0 || y === this.height() - 1
);
}
isBorder(ref: TileRef): boolean {
return this.neighbors(ref).some(
(tr) => this.ownerID(tr) != this.ownerID(ref),
(tr) => this.ownerID(tr) !== this.ownerID(ref),
);
}