Ejemplo n.º 1
0
        /// <inheritdoc/>
        public void GameHasEnded(WcfGameInfo gameInfo, WcfChessPoint from, WcfChessPoint to)
        {
            var args = new FieldInfoArgs(
                gameInfo.GameField,
                gameInfo.TurnColor,
                @from.ToBusiness(),
                to.ToBusiness(),
                gameInfo.PlayerColor,
                null);

            FieldUpdated?.Invoke(this, args);
            GameEnded?.Invoke(this, new GameEndedArgs(gameInfo.WinnerColor));
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public void GameFieldUpdated(
            ChessPiece[][] virtualField,
            PlayerColor turnColor,
            WcfChessPoint from,
            WcfChessPoint to,
            PlayerColor playerColor,
            PlayerColor?checkedPlayer)
        {
            var args = new FieldInfoArgs(
                virtualField,
                turnColor,
                from.ToBusiness(),
                to.ToBusiness(),
                playerColor,
                checkedPlayer);

            FieldUpdated?.Invoke(
                this,
                args);
        }
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public void Move(string sessionId, WcfChessPoint wcfFrom, WcfChessPoint wcfTo)
 {
     CheckSession(sessionId);
     _gameManager.Move(sessionId, wcfFrom.ToBusiness(), wcfTo.ToBusiness());
 }