Esempio n. 1
0
        private bool CheckForCapturing(TurnLog turnLog, PieceMovement pieceMovement)
        {
            bool   isGameOver        = false;
            Square destinationSquare = GetSquare(pieceMovement.To.Id);

            if (!destinationSquare.IsEmpty)
            {
                Piece removedPiece = destinationSquare.RemovePiece();
                turnLog.AddEvent(TurnEvent.CreateCapturedEvent(Position.Create(pieceMovement.To.Id)));
                if (removedPiece.Type == PieceType.King)
                {
                    isGameOver = true;
                }
            }

            return(isGameOver);
        }