Files Classes Functions Hierarchy
#include <dealer.h>
Public Member Functions | |
| dealer (deck &_cards) | |
| The dealer sees and needs a deck of cards. | |
| void | play () |
| The dealers hand is played from the hnd state. | |
| int const | playAgainst (uintc player, uintc dealer0) |
| -1 is a loss for the player 0 is a draw 1 is a win to the player | |
| void | playAgainst (double &prPlayerLoss, double &prDraw, double &prPlayerWin, long unsigned int n, uintc player, uintc dealer0) |
| Simulate the dealer playing against a player where both the dealer and the player have set hands. | |
Public Attributes | |
| deck & | cards |
| The deck of cards. | |
| hand | hnd |
| The dealer has a hand to play agains the players. | |
This class is written from the perspective of the dealer.
Additional simulation functions were added for experimentation to determine probabilities of win or loss.
Definition at line 19 of file dealer.h.
| dealer::dealer | ( | deck & | _cards | ) | [inline] |
| void dealer::play | ( | ) |
The dealers hand is played from the hnd state.
This is independent of any player.
Definition at line 5 of file dealer.cpp.
References hand::add(), cards, deck::draw(), hnd, and hand::value.
Referenced by playerGame::alive_hold(), and playAgainst().
| void dealer::playAgainst | ( | double & | prPlayerLoss, | |
| double & | prDraw, | |||
| double & | prPlayerWin, | |||
| long unsigned int | n, | |||
| uintc | player, | |||
| uintc | dealer0 | |||
| ) |
Simulate the dealer playing against a player where both the dealer and the player have set hands.
Definition at line 27 of file dealer.cpp.
-1 is a loss for the player 0 is a draw 1 is a win to the player
Definition at line 11 of file dealer.cpp.
References hand::calculate(), hnd, play(), and hand::reset().
00012 { 00013 hnd.reset(dealer0); 00014 play(); 00015 00016 uint val = hnd.calculate(); 00017 if (player<val) 00018 return -1; 00019 00020 if (val<player) 00021 return 1; 00022 00023 return 0; 00024 }
The dealer has a hand to play agains the players.
Definition at line 26 of file dealer.h.
Referenced by playerGame::alive_hold(), playerGame::notalive_dealCards(), play(), playAgainst(), and textGame::printGameState().
1.5.8