add common game
This commit is contained in:
parent
8c22f1f887
commit
225152eff3
10
src/common/CommonBoard.ts
Normal file
10
src/common/CommonBoard.ts
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
14
src/common/CommonMancalaGame.ts
Normal file
14
src/common/CommonMancalaGame.ts
Normal 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()
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user