Add draw requests and rematches
This commit is contained in:
parent
1a221bf680
commit
2f46d86947
6 changed files with 297 additions and 7 deletions
|
|
@ -100,6 +100,12 @@ export class GomokuGame {
|
|||
}
|
||||
}
|
||||
|
||||
public declareDraw() {
|
||||
this.status = 'finished';
|
||||
this.winnerColor = 'draw';
|
||||
this.currentPlayerColor = null;
|
||||
}
|
||||
|
||||
private checkWin(row: number, col: number, color: PlayerColor): boolean {
|
||||
const directions = [
|
||||
[1, 0], // vertical
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue