Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
pirms 5 gadiem
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /*------------ -------------- -------- --- ----- --- -- - -
  2. * Libre Blackjack - standard blackjack dealer
  3. *
  4. * Copyright (C) 2020 jeremy theler
  5. *
  6. * This file is part of Libre Blackjack.
  7. *
  8. * Libre Blackjack is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * Libre Blackjack is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with Libre Blackjack. If not, see <http://www.gnu.org/licenses/>.
  20. *------------------- ------------ ---- -------- -- - - -
  21. */
  22. #ifndef BLACKJACK_H
  23. #define BLACKJACK_H
  24. #include "base.h"
  25. #include "conf.h"
  26. class Blackjack : public Dealer {
  27. public:
  28. Blackjack(Configuration &);
  29. ~Blackjack();
  30. void shuffle() override;
  31. unsigned int drawCard(Hand * = nullptr) override;
  32. void deal(void) override;
  33. int process(void) override;
  34. private:
  35. unsigned int rng_seed;
  36. std::random_device dev_random;
  37. std::mt19937 rng;
  38. std::uniform_int_distribution<unsigned int> fiftyTwoCards;
  39. std::vector<unsigned int> shoe;
  40. size_t pos = 0;
  41. size_t cutCardPos = 0;
  42. bool lastPass = false;
  43. unsigned int upCard;
  44. unsigned int holeCard;
  45. unsigned int playerFirstCard;
  46. unsigned int playerSecondCard;
  47. bool hit_soft_17 = true;
  48. bool double_after_split = true;
  49. bool shuffle_every_hand = false;
  50. std::vector<unsigned int> arranged_cards;
  51. unsigned int n_arranged_cards = 0; // just to prevent calling size() each time we draw a card
  52. unsigned int i_arranged_cards = 0;
  53. unsigned int max_bet = 0;
  54. unsigned int number_of_burnt_cards = 0;
  55. double insurance = 0;
  56. double blackjack_pays = 1.5;
  57. double penetration = 0.75;
  58. double penetration_sigma = 0;
  59. void canDoubleSplit(void) {
  60. player->canDouble = playerStats.currentHand->cards.size() == 2;
  61. player->canSplit = player->canDouble && (card[*(playerStats.currentHand->cards.begin())].value == card[*(++playerStats.currentHand->cards.begin())].value);
  62. return;
  63. }
  64. };
  65. #endif