- SDL2 library for graphical user interface.
- C++ programming language for developing the game logic.
- Makefile a special file for running all necessary files.
all
→ compiles whole program.run
→ runs the compiled program (should be used afterall
).clean
→ cleans all unnecessary files when done.
make all
make run
make clean
mingw32-make -f Makefile all
mingw32-make -f Makefile run
mingw32-make -f Makefile clean
classDiagram
class GameEngine {
-SDL_Window* window
-SDL_Renderer* renderer
-GameState currentGameState
-GameMode currentGameMode
-drawPokerRound currentDrawPokerRound
+init()
+handleEvents()
+update()
+render()
+clean()
}
class Gameplay {
-Deck deck
-Storage storage
-Leaderboard leaderboard
+init()
+dealCards()
+whoWins()
+savePlayerData()
+showLeaderboard()
}
class Player {
-std::string username
-Hand hand
-bool isBot
-bool isFolded
-unsigned int chips
-float winrate
-unsigned short rank
}
class Hand {
-Card cards[5]
-int handStrength
-std::string handName
+show()
+sortCards()
+evaluateHand()
}
class Card {
-Suits suit
-Ranks rank
+suitToString()
+rankToString()
}
class Deck {
-Card cards[52]
-int remainCards
+setup()
+shuffle()
+reset()
}
class Storage {
-std::map<std::string, Player> storage
+verify()
+createNewPlayer()
+savePlayerData()
+updatePlayerStorage()
}
class Login {
-Storage storage
-std::string status
+login()
+createNewPlayer()
}
class Lobby {
-Login login
-Gameplay game
-std::vector<std::string> usernames
+assignUsername()
+removeUsername()
+handleLeaderboard()
}
GameEngine --> Gameplay : uses
GameEngine --> Lobby : uses
Gameplay --> Player : manages
Gameplay --> Deck : uses
Gameplay --> Storage : uses
Player --> Hand : has
Hand --> Card : contains
Deck --> Card : contains
Storage --> Player : stores
Login --> Storage : uses
Lobby --> Login : uses
Lobby --> Gameplay : uses