SGA-A / c2c

Source code for the custom app exclusive to cc
MIT License
1 stars 0 forks source link

Use of dataclasses to store blackjack games #153

Closed SGA-A closed 1 month ago

SGA-A commented 1 month ago

Is your feature request related to a problem? Please describe. Using a tuple to unpack data values seems quite counter-intuitive and creates more problems as opposed to solutions. So we're considering creating dataclass instances that hold a user's blackjack game metadata for as long as the game exists

Describe the solution you'd like

@dataclass(slots=True, repr=False)
class BlackjackGame:
    deck: list[int]
    player_hand: list[int]
    dealer_hand: list[int]
    player_hand_ui: list[str]
    dealer_hand_ui: list[str]
    bet: int
SGA-A commented 1 month ago

Fixed in https://github.com/SGA-A/c2c/commit/fc0bc33fddf424c96e8b0e435b7c407b01633e81