add common game

This commit is contained in:
Halit Aksoy 2022-05-02 00:43:12 +03:00
parent 8c22f1f887
commit 225152eff3
2 changed files with 24 additions and 0 deletions

10
src/common/CommonBoard.ts Normal file
View File

@ -0,0 +1,10 @@
import { Board } from '../core/Board';
const pitCountByUser = 6;
const initialStoneCountInPit = 4;
export class CommonBoard extends Board {
constructor() {
super(pitCountByUser, initialStoneCountInPit);
}
}

View File

@ -0,0 +1,14 @@
import { MancalaGame } from '../core/MancalaGame';
import { Player } from '../core/Player';
import { CommonBoard } from './CommonBoard';
import { GRLastStoneInBank } from './game_rules/GRLastStoneInBank';
import { GRLastStoneInEmptyPit } from './game_rules/GRLastStoneInEmptyPit';
export class CommonMancalaGame extends MancalaGame {
constructor(player1: Player, player2: Player) {
super(new CommonBoard(), player1, player2, player1.id, [
new GRLastStoneInEmptyPit(),
new GRLastStoneInBank()
]);
}
}