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

Add ability for cards to be revealed at the end of the hand #1566

Open
ctm opened this issue Feb 19, 2025 · 3 comments
Open

Add ability for cards to be revealed at the end of the hand #1566

ctm opened this issue Feb 19, 2025 · 3 comments
Assignees
Labels
easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon request Something explicitly asked for teaching Features to help teach poker

Comments

@ctm
Copy link
Owner

ctm commented Feb 19, 2025

Add a checkbox to the teacher's table that causes all cards to be revealed at the end of the hand.

FWIW, I've already done a bunch of the work for this in the auto-pause-1563 branch, where I've commented out the tooltip mention of this functionality and have commented out the admin check-box. I have not yet surveyed what needs to be done, but off the top of my head, I think need to store folded cards somewhere and then just restore those before sending an extra status message at the end if teacher has checked the box. If so, this is just a few hours of work (beyond the work I already did while working on #1563).

@ctm ctm added easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon request Something explicitly asked for teaching Features to help teach poker labels Feb 19, 2025
@ctm ctm self-assigned this Feb 19, 2025
@ctm
Copy link
Owner Author

ctm commented Feb 19, 2025

After sleeping on it and quickly skimming the code, this still looks easy. Table::fold contains:

        let folded_cards = player.fold();
        self.muck
            .add(&folded_cards, folded_cards.len().try_into().unwrap());

We'll have to store a copy of folded_cards, but rather than keeping them in Player, we'll want to keep them in TeachingState, either in a Vec indexed by seat or a HashMap indexed by PlayerId. Once I look at exactly what we'll do on showdown, it'll be obvious.

The issue I haven't thought through yet is player motion, but I don't think we even need to deal with that for a first release. Once everything else is done, if player motion is outstanding, we can just make a new GitHub issue.

So, AFAICT, this issue requires less than a day to complete, but I'm a little backlogged in non-programming things, since I was spending my useful hours working on auto-pause (#1563).

@ctm
Copy link
Owner Author

ctm commented Feb 21, 2025

FWIW, when I finally got to working on this yesterday afternoon, I decided the way to proceed is a little different, because although the biggest interest currently is training people how to play Hold'em, a slightly different architecture will support teaching all games, including ones with multiple draws. The tricky part will be the UI, however, I can still implement the non-UI aspect the new, all-encompassing way and—for now—slap what I was planning on doing for Hold'em on top of it.

IOW, once again, my server will have capabilities that are limited by the UI, but at least I'm not painting myself into a corner at the server or message level.

More later…

@ctm
Copy link
Owner Author

ctm commented Feb 24, 2025

I've decided that how I want to proceed is to use poker_stars::History to communicate hidden card info, possibly with the addition of graphical depiction of cards for games where there are no draws (e.g., Hold'em and Stud). As such, I'll need to implement HandLines::new in my PS-compatible hand history branch (#576) before that functionality can be used here. However, the preceding data structures (TableInfo, ForcedBet and PlayerInfo are all simple enough that I'll likely do them in order before getting to HandLines, because I will probably want to merge an incomplete history-576 into master before continuing with this branch, and PS-compatible through HandLines, but without Resolution and Summary would at least be a good sign of progress and not as jarring as just implementing HandLines without the preceding parts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
easy Trivial to do (even when tired!) and semi-worthwhile high priority Should be done fairly soon request Something explicitly asked for teaching Features to help teach poker
Projects
None yet
Development

No branches or pull requests

1 participant