Skip to content

Commit

Permalink
Add playerToMoveOnOfficialBranch method
Browse files Browse the repository at this point in the history
  • Loading branch information
anoek committed Jan 8, 2024
1 parent 8657160 commit fd7c86b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/GoEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,11 @@ export class GoEngine extends EventEmitter<Events> {
return players.map((p) => p.id).includes(player_id);
}

public playerToMoveOnOfficialBranch(): number {
return this.last_official_move.state.player === 1
? this.players.black.id
: this.players.white.id;
}
public playerToMove(): number {
return this.player === 1 ? this.players.black.id : this.players.white.id;
}
Expand Down

0 comments on commit fd7c86b

Please sign in to comment.