mancala/packages/mancala.js/tests/TestUtil.ts

28 lines
823 B
TypeScript
Raw Permalink Normal View History

2022-05-08 16:57:59 +03:00
import { GRClearBoardAtEnd } from '../src/common/game_rules/GRClearBoardAtEnd';
import { GRLastStoneInBank } from '../src/common/game_rules/GRLastStoneInBank';
import { GRLastStoneInEmptyPit } from '../src/common/game_rules/GRLastStoneInEmptyPit';
2022-05-21 18:36:00 +03:00
import { GRDoubleStoneInPit } from '../src/common/game_rules/GRDoubleStoneInPit';
2022-05-08 16:57:59 +03:00
import { Board } from '../src/core/Board';
import { MancalaGame } from '../src/core/MancalaGame';
export function createGame(): MancalaGame {
const board = new Board(6, 4);
const player1Id = '0';
const player2Id = '1';
const game = new MancalaGame(
'0',
board,
player1Id,
player2Id,
player1Id,
[
new GRLastStoneInEmptyPit(),
2022-05-21 18:36:00 +03:00
new GRDoubleStoneInPit(),
2022-05-08 16:57:59 +03:00
new GRLastStoneInBank(),
new GRClearBoardAtEnd()
],
[]
);
return game;
}