April 2018
Beginner
340 pages
7h 54m
English
As you may remember from the previous chapters, when the player chooses to stick, the round is automatically over, and the winner needs to be determined by comparing the player's hand to the dealer's.
The method called by our stick button is that of the GameWindow itself. This method only passes on the stick choice to the GameScreen:
def stick(self): self.game_screen.stick()
The GameScreen grabs the final state from our GameState, then performs the same steps as it did when we found a winner during our hit logic:
def stick(self): table_state = self.game_state.calculate_final_state() self.show_dealers_cards(table_state) self.show_winner_text(table_state['has_winner']) self.master.on_winner()
The final state is calculated ...