mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-24 07:14:41 +00:00
GameMap
This commit is contained in:
@@ -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),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user