Best way to customize dealing?
Currently the dealer is set up to deal all cards (at the start), randomly, with no restriction. This works for any number of decks, stacks, etc. The only time I expect this to be inadequate is if a game (or debugging) requires us to deal cards in a particular order.
The questions we face are:
- Do we want the dealing logic to remain completely in dealer?
- Reduces the modularity of the program
- Requires most effort because we need to subclass dealer for each type of game
- Do we want an optional deal method in the game subclass, have dealer try that, and if there is none then use standard dealing?
- Modular approach
- Provides redundancy with the standard dealing
- Do we want to put all of the dealing logic into the game subclasses?
- The game subclasses currently have their own initialization of the cards and layouts, as well as logic for in-game dealing
- Definitely the most modular approach, +1 for information hiding as well
- We will need to specify a hierarchy of game subclasses. Currently we have CardGame as parent, then the individual game as child. We will need to add a middle-man for each given type of game (grouped by type of dealing) to avoid a mass amount of duplicated code
Documentation, Design, or Implementation related?
Implementation
Implementation:
- Applies to the interaction of model and controller
- Functionality is in dealer.py in the control package and game subclasses in the model package