-
Notifications
You must be signed in to change notification settings - Fork 9
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
geat(plugin): implement cloning for GameState & Board #356
Conversation
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.
Looks good generally.
I've just noted two style questions
&& board == other.board | ||
&& lastMove == other.lastMove | ||
&& lastMoveMono == other.lastMoveMono | ||
&& turn == other.turn) |
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.
Since Kotlin doesn't have enforced semicolon to mark line endings, in ambigous cases of multi-line statements you need to put the operator at the end of the previous line (which is why ||
has to be at the end of the line).
Thus I think it's cleaner to put every operator of multi-line statements at the end of the line, rather than the beginning
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.
though having the operators aligned improves readability imo 🤔
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.
no, the ||
can also be at the beginning of the line, this isn't really an ambiguous case.
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.
oh, really?
I thought it couldn't know the return continues over several lines.
But maybe they just fixed that already
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.
If it's possible I wonder why you don't put the ||
at the beginning of the next line. That should improve readability even more, then
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.
because then it would be in front of the parentheses and thus not aligned either.
<field x="8" y="6" content="YELLOW"/> | ||
<field x="5" y="9" content="BLUE"/> | ||
</board> | ||
<lastMoveMono class="linked-hash-map"/> |
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.
is it fine to just reorder the XML?
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.
Depends on how the pupils parse it 😕 I would prefer to not change it mid-season.
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.
Nice! Is there a good reason to change the XML?
field = 1 + turn / orderedColors.size | ||
return field | ||
} | ||
internal val validColors: MutableSet<Color> = |
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.
How about a comment explaining what validColors is?
<field x="8" y="6" content="YELLOW"/> | ||
<field x="5" y="9" content="BLUE"/> | ||
</board> | ||
<lastMoveMono class="linked-hash-map"/> |
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.
Depends on how the pupils parse it 😕 I would prefer to not change it mid-season.
It changes depending on the ordering of the fields in the class, which seems much more sensible to me now. |
- implement Gamestate equality correctly - implement cloning for GameState & Board - slight GameState XML change due to reorderings
No description provided.