mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:50:43 +00:00
refactor(GameRunner): remove pendingTurns and hasPendingTurns methods
- Removed the pendingTurns and hasPendingTurns methods from GameRunner - Updated Worker.worker.ts to simplify the check for pending turns
This commit is contained in:
@@ -181,10 +181,6 @@ export class GameRunner {
|
||||
return true;
|
||||
}
|
||||
|
||||
public pendingTurns(): number {
|
||||
return Math.max(0, this.turns.length - this.currTurn);
|
||||
}
|
||||
|
||||
public playerActions(
|
||||
playerID: PlayerID,
|
||||
x?: number,
|
||||
@@ -268,8 +264,4 @@ export class GameRunner {
|
||||
}
|
||||
return player.bestTransportShipSpawn(targetTile);
|
||||
}
|
||||
|
||||
public hasPendingTurns(): boolean {
|
||||
return this.currTurn < this.turns.length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ async function processPendingTurns() {
|
||||
}
|
||||
|
||||
const gr = await gameRunner;
|
||||
if (!gr || !gr.hasPendingTurns()) {
|
||||
if (!gr) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user