Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InputAction should support inputting actions by using any notation #11

Open
marianogappa opened this issue Apr 19, 2020 · 0 comments
Open

Comments

@marianogappa
Copy link
Owner

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"`
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant