Update example for MAKE_MOVE JSON payload#361
Open
josephgeis wants to merge 1 commit intosoftwareconstruction240:mainfrom
Open
Update example for MAKE_MOVE JSON payload#361josephgeis wants to merge 1 commit intosoftwareconstruction240:mainfrom
josephgeis wants to merge 1 commit intosoftwareconstruction240:mainfrom
Conversation
The example on line 130 was inconsistent with what the passoff tests were expecting for the MAKE_MOVE command
Contributor
|
I'm trying to validate the assertion that the passoff tests require a specific serialized format. The starter code specifies the constructor and getters, but not the field names. public class ChessMove {
public ChessMove(ChessPosition startPosition, ChessPosition endPosition,
ChessPiece.PieceType promotionPiece) {
}
/**
* @return ChessPosition of starting location
*/
public ChessPosition getStartPosition() {
throw new RuntimeException("Not implemented");
}
/**
* @return ChessPosition of ending location
*/
public ChessPosition getEndPosition() {
throw new RuntimeException("Not implemented");
}
/**
* Gets the type of piece to promote a pawn to if pawn promotion is part of this
* chess move
*
* @return Type of piece to promote a pawn to, or null if no promotion
*/
public ChessPiece.PieceType getPromotionPiece() {
throw new RuntimeException("Not implemented");
}
}Can you point to which specific test you found that requires a specific serialization format for |
Contributor
|
I modified my implementation of public class ChessMove {
private final ChessPosition start;
private final ChessPosition endPosition;
private final ChessPiece.PieceType promotionPiece;
public ChessMove(ChessPosition startPosition, ChessPosition endPosition,
ChessPiece.PieceType promotionPiece) {
this.start = startPosition;
this.endPosition = endPosition;
this.promotionPiece = promotionPiece;
}
...Is it possible that you are serializing in a way that couples the field names is some way that isn't necessary? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The example on line 130 was inconsistent with what the passoff tests were expecting for the MAKE_MOVE command