ctm / mb2-doc

Mb2, poker software
https://devctm.com
7 stars 2 forks source link

Implement Display for GameInfo #1399

Closed ctm closed 5 months ago

ctm commented 5 months ago

Refactor so that GameInfo and GameGroup both implement Display via having Options implement Display.

This is a a refactor that is a step toward moving options from Options into the GameType variants, which is what we'll want to do before creating the game builder and structure builder. By doing it now, we can make it so that we don't need Stakes to instantiate a new game just so we can display the game name in a way that doesn't actually show stakes. IOW, it allows me to clean up some of the structure template/sheets code.

To do this we'll need to:

ctm commented 5 months ago

Ugh. If I do the above, I'll also need to remove from all the games, the fields which come directly from options. Otherwise, there'd be the possibility of conflict. That's not that big of a deal in and of itself, and it will bring me even closer to moving Options into GameType, but that's an attractive nuisance. It will require self-discipline to not go the whole nine yards…

ctm commented 5 months ago

FWIW, I was only going to do this because I thought I could quickly do some of the more tedious stuff with sed. Turns out, I can't make sed stop inserting after a search. The :a;n;ba trick does not appear to work after an insert. I could, however, just be holding it wrong.

No problem, emacs keyboard macros to the rescue, right? Well, I made a typo and when ^G'ing out of my definition, emacs got out its output out of sync with its input, something that I believe is related to the rust analyzer, since I only started seeing that out of sync problem after adding a bunch of rust stuff to emacs. So, I closed emacs and am starting afresh, but this is becoming a time sink and may be something I either do another day or skip entirely and go directly to moving Options into GameType (and subsuming GameGroup into GameType).

ctm commented 5 months ago

Done. Deploying now. Took me longer than I'd like, but I'm happy with the results.