-
Notifications
You must be signed in to change notification settings - Fork 102
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
adds new board to game over screen #870
base: main
Are you sure you want to change the base?
adds new board to game over screen #870
Conversation
5988e9d
to
04a7460
Compare
@@ -46,6 +51,10 @@ class GameSessionWorkflow( | |||
data class GameOver(val board: Board) : State() | |||
} | |||
|
|||
sealed class Output { | |||
object NewBoard : Output() |
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.
Seems like this doesn't need to be a sealed class if we do the same thing any time any type of Output
is emitted!
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.
I went with this instead of just an object Output
in the spirit of it being a sample that people can add to. I will foundations make the call here.
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.
We actively discourage this kind of things as a speculative YAGNI (you ain't gonna need it) violation. Definitely wouldn't want to see it in a sample.
I won't be able to give the PR a proper review until next week. In the meantime, thanks for the contribution!
message = "You've been eaten, try again.", | ||
cancelable = false, | ||
onEvent = { context.actionSink.send(restartGame()) } | ||
onEvent = { | ||
if (it is ButtonClicked) { |
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.
nit: I feel like if (it is ButtonClicked && it.button == NEUTRAL) { ... } else {...}
would more closely replicate the original behavior
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 with the change of Output
to an object NewBoard
closes #205