Example #1
0
        private async Task OnPieceMovedAsync(PieceMovedEvent pieceMovedEvent)
        {
            if (pieceMovedEvent.GameId != gameId)
            {
                return;
            }

            await clientProxy.SendAsync(nameof(IGameHubClient.OnPieceMoved), pieceMovedEvent);
        }
Example #2
0
        private void OnPieceMoved(PieceMovedEvent pieceMovedEvent)
        {
            var from = pieceMovedEvent.PieceMove.From.AsDomain();
            var to   = pieceMovedEvent.PieceMove.To.AsDomain();

            var move = movesSequenceTranslator.TranslateNextMove(from, to);

            var shouldUpdateToLatest = movesReplayer.IsAtLastMove;

            movesReplayer.AddMove(move);

            if (shouldUpdateToLatest)
            {
                movesReplayer.ToLastMove();
            }

            NotifyStateChanged();
        }
Example #3
0
 private async void OnPieceMoved(PieceMovedEvent pieceMovedEvent)
 {
     await OnPieceMovedAsync(pieceMovedEvent);
 }