Refactor GameImpl and GameView methods to remove unnecessary return statements

- Updated setOwnerID, setDefended, forEachTile, and setFallout methods in GameImpl and GameView to eliminate redundant return statements
This commit is contained in:
scamiv
2025-12-04 16:36:57 +01:00
parent 8752642e46
commit 0d1769fc92
2 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -863,7 +863,7 @@ export class GameImpl implements Game {
return this._map.hasOwner(ref);
}
setOwnerID(ref: TileRef, playerId: number): void {
return this._map.setOwnerID(ref, playerId);
this._map.setOwnerID(ref, playerId);
}
hasFallout(ref: TileRef): boolean {
return this._map.hasFallout(ref);
@@ -874,7 +874,7 @@ export class GameImpl implements Game {
}
setDefended(ref: TileRef, value: boolean): void {
return this._map.setDefended(ref, value);
this._map.setDefended(ref, value);
}
isBorder(ref: TileRef): boolean {
return this._map.isBorder(ref);
@@ -898,7 +898,7 @@ export class GameImpl implements Game {
return this._map.terrainType(ref);
}
forEachTile(fn: (tile: TileRef) => void): void {
return this._map.forEachTile(fn);
this._map.forEachTile(fn);
}
manhattanDist(c1: TileRef, c2: TileRef): number {
return this._map.manhattanDist(c1, c2);
+4 -4
View File
@@ -846,13 +846,13 @@ export class GameView implements GameMap {
return this._map.hasOwner(ref);
}
setOwnerID(ref: TileRef, playerId: number): void {
return this._map.setOwnerID(ref, playerId);
this._map.setOwnerID(ref, playerId);
}
hasFallout(ref: TileRef): boolean {
return this._map.hasFallout(ref);
}
setFallout(ref: TileRef, value: boolean): void {
return this._map.setFallout(ref, value);
this._map.setFallout(ref, value);
}
isDefended(ref: TileRef): boolean {
@@ -860,7 +860,7 @@ export class GameView implements GameMap {
}
setDefended(ref: TileRef, value: boolean): void {
return this._map.setDefended(ref, value);
this._map.setDefended(ref, value);
}
isBorder(ref: TileRef): boolean {
return this._map.isBorder(ref);
@@ -884,7 +884,7 @@ export class GameView implements GameMap {
return this._map.terrainType(ref);
}
forEachTile(fn: (tile: TileRef) => void): void {
return this._map.forEachTile(fn);
this._map.forEachTile(fn);
}
manhattanDist(c1: TileRef, c2: TileRef): number {
return this._map.manhattanDist(c1, c2);