Esempio n. 1
0
        internal static Move TransformIntoMoveInstance(Piece item, Cell currentCell)
        {
            Move move   = new Move();
            var  coords = MoveNotationCoordinatesConverter.ConvertChessCoordinatesToArrayIndexes(currentCell.X, currentCell.Y);

            move.Coordinate = coords;
            move.Name       = item.Name;
            move.PieceColor = item.PieceColor;
            return(move);
        }
Esempio n. 2
0
        private static void ConvertNotationMoveIntoMove(PieceColor pieceColor, string coordinatesFromMove, char promotion, string checkOrCheckMate, string pieceUppercase, Move move)
        {
            var coordinate = MoveNotationCoordinatesConverter.ConvertChessCoordinatesToArrayIndexes(coordinatesFromMove);

            move.Coordinate  = coordinate;
            move.Promotion   = CreatePiece(promotion, pieceColor);
            move.Name        = ConvertPieceInitialFromMoveToPieceName(pieceUppercase);
            move.PieceColor  = pieceColor;
            move.IsCheck     = checkOrCheckMate.Length == 1 ? true : false;
            move.IsCheckMate = checkOrCheckMate.Length == 2 ? true : false;
            move.Coordinates = coordinatesFromMove;
        }