public Game NewGame(string playerName) { var game = gameFactory.NewGame(playerName); drawer.DrawTilesForAllPlayers(game); gameRepo.Set(game); return(game); }
private IGame ToGame(ilf.pgn.Data.Game pgnGame) { var game = _gameFactory.NewGame(); foreach (var pgnMove in pgnGame.MoveText) { if (pgnMove.Type == ilf.pgn.Data.MoveTextEntryType.MovePair) { var twoMoves = pgnMove as ilf.pgn.Data.MovePairEntry; MakeMove(game, twoMoves.White); MakeMove(game, twoMoves.Black); } else if (pgnMove.Type == ilf.pgn.Data.MoveTextEntryType.SingleMove) { MakeMove(game, (pgnMove as ilf.pgn.Data.HalfMoveEntry).Move); } } return(game); }
private void NewGame(IGame game = null) { _game = game ?? _gameFactory.NewGame(); uxChessBoardMain.setChessGame(_game); }