-
Notifications
You must be signed in to change notification settings - Fork 247
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
Fixed marking cells with bombs for example mines
#792
Fixed marking cells with bombs for example mines
#792
Conversation
…earby unmarket cells by middle mouse click and count scores.
All state moved to model (flag marks) therefore `border::view::Overlay` became meaningless type and was removed. Now method `BoardView::draw()` using data about cells from model.
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.
Thanks for the work, looks great! I admit I kinda forgot about this example, but it deserves more attention!
Just a couple comments, and it should be good to merge!
cursive/examples/mines/board/view.rs
Outdated
(Closed, _, false) => " □", | ||
(Marked, _, false) => " ■", | ||
(Opened, Free(n), false) | (_, Free(n), true) => [" ", " 1", " 2", " 3", " 4", " 5", " 6", " 7", " 8"][n], | ||
(Opened, Bomb, false) | (_, Bomb, true) => "\u{01F4A3} " |
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.
From my tests the 💣
character is rendered double-width, so no need for a space after?
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 agree, I removed redundant space
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
Co-authored-by: Alexandre Bury <[email protected]>
@gyscos, PR is ready to merge |
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.
Thanks again for the work!
Actually I don't know goal of this example and would this changes acceptable.
For fixing
auto_reveal
behaviour, it needs information about marked cells in model.When
Marked
state moved to border's model. All data about cells state become in the model cells, therefore much easy was remove synchronization cell's state between view and model and cell's state from view and just share cells state from model to view (and draw it).This PR depends on #790