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

adds new board to game over screen #870

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LandonPatmore
Copy link

closes #205

@CLAassistant
Copy link

CLAassistant commented Aug 30, 2022

CLA assistant check
All committers have signed the CLA.

@LandonPatmore LandonPatmore force-pushed the lpatmore/samples/dungeon-update branch from 5988e9d to 04a7460 Compare August 30, 2022 05:19
@@ -46,6 +51,10 @@ class GameSessionWorkflow(
data class GameOver(val board: Board) : State()
}

sealed class Output {
object NewBoard : Output()
Copy link
Collaborator

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!

Copy link
Author

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.

Copy link
Contributor

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) {
Copy link
Collaborator

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

Copy link
Contributor

@steve-the-edwards steve-the-edwards left a 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

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

Successfully merging this pull request may close these issues.

Add a "New Board" button to the Game Over dialog in the Dungeon Crawler sample.
5 participants