Advertisement
Egor_Vakar

Core.hpp (coursework)

Dec 26th, 2022
1,031
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.03 KB | None | 0 0
  1. #pragma once
  2.  
  3. #include <iostream>
  4. #include <vector>
  5. #include <cstdint>
  6. #include <memory>
  7. #include <SFML/Graphics.hpp>
  8. #include <SFML/Audio.hpp>
  9.  
  10. #include "Cards.hpp"
  11.  
  12.  
  13. class TableHandle{
  14. public:
  15.     int bet = 0;
  16.     int chips = 2000;
  17.     int dealersum = 0;
  18.     int playersum = 0;
  19.     int wins, lose, tie;
  20.     int guidePage = 1;
  21.     bool saveGame = false;
  22.     bool updGame = false;
  23.     bool newGame = false;
  24.     bool showDevInfo = false;
  25.     bool showGuide = false;
  26.     bool playerturn = true;
  27.     bool gamerun = true;
  28.     bool firstCards = true;
  29.     bool buttonLocked = false;
  30.     bool showPlayerWinner = false;
  31.     bool showTableWinner = false;
  32.     bool showTie = false;
  33.  
  34.     float dt = 0;
  35.     float delayAI = 0;
  36.     float delayShowWinner = 0;
  37.  
  38.     std::vector<Cards> playerCards;
  39.     std::vector<Cards> tableCards;
  40.  
  41.     sf::Texture cardsSprite;
  42.     sf::Texture tableWinTex;
  43.     sf::Texture playerWinTex;
  44.     sf::Texture tieTex;
  45.     sf::Sprite tableWinSpr;
  46.     sf::Sprite playerWinSpr;
  47.     sf::Sprite tieSpr;
  48.  
  49.     sf::Font font;
  50.     sf::Text playerDisplay;
  51.     sf::Text tableDisplay;
  52.     sf::Text playerStats;
  53.     sf::Text tableStats;
  54.     sf::Text tieStats;
  55.     sf::Text playersChips;
  56.     sf::Text totalBet;
  57.     sf::Text playersSumTxt;
  58.     sf::Text dealersSumTxt;
  59.  
  60.     enum Actions{
  61.         Hit = 1,
  62.         AskStop = 2,
  63.         AskQuit = 3,
  64.         MakeBet = 4,
  65.         Play = 5,
  66.         DevInfo = 6,
  67.         ShowGuide = 7,
  68.         SwipeLeft = 8,
  69.         SwipeRight = 9,
  70.         SaveGame = 10,
  71.         UpdGame = 11
  72.     };
  73.  
  74.     bool lockedAI = false;
  75.     bool lockedShowWinner = false;
  76.     bool doOnce = false;
  77.     bool doOnceWinner = false;
  78.  
  79.  
  80. public:
  81.     explicit TableHandle(sf::Texture&, float& dt );
  82.     ~TableHandle();
  83.  
  84.     void EventHandle(enum Actions);
  85.     void EventStop();
  86.     void EventQuit();
  87.     void RestartMatch();
  88.  
  89.     void GameRun(float&);
  90.  
  91.     uint16_t CheckWins();
  92.     bool EventAddCards();
  93.  
  94.     void DrawTable(sf::RenderWindow& app, float& );
  95.  
  96.     int getTurn();
  97.  
  98.     void EventBet();
  99.     void EventStartNew();
  100.  
  101.     void EventBet(sf::RenderWindow &app, float &dt);
  102.  
  103.     static void EventBetDown();
  104. };
  105.  
  106.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement