Beispiel #1
0
        public void DoMove(UserId currentUserId, GameId gameId, SquareId from, SquareId to)
        {
            _unitOfWork.WithGameTransaction(tran => {
                var(game, gameState) = FindGameAndState(gameId);
                _playGameDomainService.DoMove(game, gameState, currentUserId, from, to);

                _gameRepository.Save(game);
                _gameStateRepository.Save(gameState);

                tran.Commit();
            });
        }
Beispiel #2
0
        private void DoMoveAs(Game game, GameState gameState, int from, int to, Color color)
        {
            var player = game.Players.Single(p => p.Color == color);

            _playGameService.DoMove(game, gameState, player.UserId, new SquareId(from), new SquareId(to));
        }