private List <GameMove> GetSoftValidMoves(Chessboard chessboard, ChessPieceCoordinate chessPieceCoordinate, GameHistory history) { var fromCoordinate = chessPieceCoordinate.Coordinate; var chessPiece = chessPieceCoordinate.ChessPiece; switch (chessPiece.Type) { case ChessPieceType.King: return(_kingMoveValidator.GetSoftValidKingMoves(chessboard, fromCoordinate, chessPiece.Owner)); case ChessPieceType.Queen: return(_queenMoveValidator.GetSoftValidQueenMoves(chessboard, fromCoordinate, chessPiece.Owner)); case ChessPieceType.Rook: return(_rookMoveValidator.GetSoftValidRookMoves(chessboard, fromCoordinate, chessPiece.Owner)); case ChessPieceType.Bishop: return(_bishopMoveValidator.GetSoftValidBishopMoves(chessboard, fromCoordinate, chessPiece.Owner)); case ChessPieceType.Knight: return(_knightMoveValidator.GetSoftValidKnightMoves(chessboard, fromCoordinate, chessPiece.Owner)); case ChessPieceType.Pawn: return(_pawnMoveValidator.GetPawnKillMoves(chessboard, fromCoordinate, chessPiece.Owner, history.GetLastMove())); default: throw new ArgumentOutOfRangeException(nameof(chessPiece.Type), chessPiece.Type, null); } }