Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

vor 5 Jahren
vor 5 Jahren
vor 5 Jahren
vor 5 Jahren
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*------------ -------------- -------- --- ----- --- -- - -
  2. * Libre Blackjack - base classes
  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. #include <iostream>
  23. #include "base.h"
  24. void Hand::render(bool holeCardShown) {
  25. for (auto it : cards) {
  26. std::cout << " _____ ";
  27. }
  28. std::cout << std::endl;
  29. unsigned int i = 0;
  30. for (auto it : cards) {
  31. if (holeCardShown || i != 1) {
  32. std::cout << "|" << card[it].getNumberASCII() << ((card[it].number != 10)?" ":"") << " | ";
  33. } else {
  34. std::cout << "|#####| ";
  35. }
  36. i++;
  37. }
  38. std::cout << std::endl;
  39. i = 0;
  40. for (auto it : cards) {
  41. if (holeCardShown || i != 1) {
  42. std::cout << "| | ";
  43. } else {
  44. std::cout << "|#####| ";
  45. }
  46. i++;
  47. }
  48. std::cout << std::endl;
  49. i = 0;
  50. for (auto it : cards) {
  51. if (holeCardShown || i != 1) {
  52. std::cout << "| " << card[it].getSuitUTF8() << " | ";
  53. } else {
  54. std::cout << "|#####| ";
  55. }
  56. i++;
  57. }
  58. std::cout << std::endl;
  59. i = 0;
  60. for (auto it : cards) {
  61. if (holeCardShown || i != 1) {
  62. std::cout << "| | ";
  63. } else {
  64. std::cout << "|#####| ";
  65. }
  66. i++;
  67. }
  68. std::cout << std::endl;
  69. i = 0;
  70. for (auto it : cards) {
  71. if (holeCardShown || i != 1) {
  72. std::cout << "|___" << ((card[it].number != 10)?"_":"") << card[it].getNumberASCII() << "| ";
  73. } else {
  74. std::cout << "|#####| ";
  75. }
  76. i++;
  77. }
  78. std::cout << std::endl;
  79. return;
  80. }