cheesse
cheesse copied to clipboard
InputAction should support inputting actions by using any notation
Currently, InputAction looks like this:
type InputAction struct {
FromSquare string `json:"fromSquare"`
ToSquare string `json:"toSquare"`
PromotionPieceType string `json:"promotionPieceType"`
}
This means that an action can only be referenced to by supplying the fromSquare, toSquare in Algebraic Notation, and the optional promotionPieceType.
This is fine and unambiguous, but in some cases the caller will only have the action in some notation, and there's no good reason not to support this use case.
One way to support this is having optional properties for each notation, e.g.:
type InputAction struct {
FromSquare string `json:"fromSquare"`
ToSquare string `json:"toSquare"`
PromotionPieceType string `json:"promotionPieceType"`
Algebraic string `json:"algebraic"`
Descriptive string `json:"descriptive"`
...
}