本文整理汇总了TypeScript中BoardComponents/Board.Board.initialise方法的典型用法代码示例。如果您正苦于以下问题:TypeScript Board.initialise方法的具体用法?TypeScript Board.initialise怎么用?TypeScript Board.initialise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BoardComponents/Board.Board
的用法示例。
在下文中一共展示了Board.initialise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: clone
private static clone(source: Board): Board {
var clone = new Board();
let layout = new Array<number[]>();
for (let pointId = 0; pointId < 26; pointId++) {
layout[pointId] = [source.checkerContainers[pointId].checkers[PlayerId.BLACK], source.checkerContainers[pointId].checkers[PlayerId.RED]]
}
clone.initialise(layout);
return clone;
}
示例2: constructor
constructor(containerId: string, blackIsComputer = false, redIsComputer = false) {
let board = new Board();
let dice = new Dice(new DiceRollGenerator());
let statusLogger = new StatusLogger();
let game = new Game(board, dice, statusLogger, [blackIsComputer, redIsComputer]);
let ui = new GameUI(containerId, game);
board.initialise();
// TODO: UI trigger game to begin
dice.rollToStart(statusLogger, (successfulPlayer: PlayerId) => {
game.begin(successfulPlayer);
});
}