diff --git a/src/common/CommonBoard.ts b/src/common/CommonBoard.ts new file mode 100644 index 0000000..a77667c --- /dev/null +++ b/src/common/CommonBoard.ts @@ -0,0 +1,10 @@ +import { Board } from '../core/Board'; + +const pitCountByUser = 6; +const initialStoneCountInPit = 4; + +export class CommonBoard extends Board { + constructor() { + super(pitCountByUser, initialStoneCountInPit); + } +} diff --git a/src/common/CommonMancalaGame.ts b/src/common/CommonMancalaGame.ts new file mode 100644 index 0000000..ff18f96 --- /dev/null +++ b/src/common/CommonMancalaGame.ts @@ -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() + ]); + } +}