-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat(plugin): use MoveMistakes to construct InvalidMoveExceptions #321
Conversation
d74ed32
to
16eb943
Compare
The only issue that remains now is the inflexibility to pass information to InvalidMoveExceptions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Muss dafür etwas in der GUI angepasst werden?
@anarchuser rebase or squash? |
if you squash, please make the commit message a little more descriptive |
squash and yes. |
oof, I was about to announce its release. I thought it was merged already... |
Why does it need adjusting though? |
nothing special, no, but there's a failing test |
oh, and the gui doesn't display the message from the MoveMistake but simply "Regelverletzung" ^^ |
There will always be a distinctive set of types of invalid moves players can make. The type of mistake that happened should be easily communicatable.
This allows for less customisability for InvalidMoveExceptions but makes the type of exceptions clear and potentially reduces redundancy
With this, automated detection of the type of mistake that happened is possible
3d176e2
to
764f279
Compare
Due to the changes to InvalidMoveExceptions it doesn't take a string anymore. Thus, the Test classes need their own subset of MoveMistakes
I fixed the failing tests (nothing broken, I just needed to adapt them to the changes). |
InvalidMoveExceptions
are now being constructed with aMoveMistake
and an optionalMove
, as opposed to String + optional Move.This merges the previous ideas of returning
MoveMistakes
or throwingInvalidMoveExceptions
from validation functions.This in turn allows to cleanly distinguish the different exceptions from a limited set of mistake types, at the cost of arbitrary error messages.
Resolves #320