Welcome to the Board Games project! The goal of this project is to provide modules that can be used to create various board games. Each module is designed to be reusable and easy to extend, allowing for the creation of complex game mechanics with ease.
- Created Games
- Current Modules
- UML Diagram
- Repository Structure
- Requirements
- Repository Initialization
- Modules
- Games
- Contribution
- PigDices: A dice game where players roll dice to accumulate points.
- War: A card game where players compete to capture all the cards.
- Poker: A classic card game based on betting and strategy.
- Card: Base class for all types of cards.
- ComparableCard: Extension of the Card class that allows for card comparison.
- StandardCard: A standard playing card with ranks and suits.
- Currency: Module for handling in-game currency.
- Deck: Base class for card decks.
- StandardDeck: A standard 52-card deck.
- Dice: Module for handling dice rolls.
- Game: Base class for all games.
- Player: Base class for all players.
The UML diagram, presented in the file Structure.png, illustrates the class structure in the Board Games project.

The Board Games project repository is divided into several main directories, making it easy to organize code, tests, and executable files. Below is the description of the directory structure:
-
executables/Debug:
- Contains
.exefiles for games and tests. - Structure:
executables/Debug/ ├── basetests.exe ├── pig_dices_tests.exe ├── Pig_Dices.exe ├── Poker.exe ├── War.exe ├── wartests.exe
- Contains
-
tests/:
- Contains tests for the respective modules.
- Structure:
tests/ ├── BaseGameTests/ ├── PigDicesTests/ ├── WarTests/ └── PokerTests/
-
src/:
- Contains folders with source code.
- Structure:
src/ ├── BaseGame/ ├── PigDices/ ├── War/ ├── Poker/ ├── PigDices_interface/ ├── War_interface/ └── Poker_interface/
Each directory contains the appropriate source, header, and test files, ensuring clarity and ease of navigation within the project.
- CMake 3.14 or later
- C++ compiler supporting C++20
- Git
- Clone the repository to your chosen folder.
- Create a "build" directory inside the repository.
- Using the command line (terminal, PowerShell...) navigate to the build directory with the command
cd ./build. - Enter
cmake .. - Enter
cmake --build . - If there is an error, repeat the last 2 steps.
- After compilation, the program should be located in
{repo}/executablesor{repo}/executables/Debug. - To run the program, navigate to the directory where the program is located and enter
./{SelectedGame/Test}.exein the terminal or run the{SelectedGame/Test}.exefile from the graphical interface.
The Card class is a base class representing a generic card. It contains basic properties such as the card name.
The ComparableCard class extends Card and allows for comparing cards based on defined criteria.
The StandardCard class represents a single standard playing card, inheriting from ComparableCard.
The Currency class is used to handle the value of currency in the game. It allows setting, getting, adding, and updating the currency value.
The Deck class is a virtual base class containing a vector of pointers to objects derived from Card. It includes methods for randomly drawing cards and resetting the deck.
The StandardDeck class represents a standard 52-card deck, inheriting from Deck. It includes a method for resetting the deck, creating a standard set of cards.
The Dice class handles dice rolls with a specified number of sides.
The Game class is a base class for all games, containing common methods and properties such as adding players, starting the game, managing turns, and checking win conditions.
The Player class is a base class for all players, containing common properties and methods such as storing the player's name.
The PigDicesGame class represents a dice game where players take turns rolling dice to accumulate points. The first player to reach a set number of points wins.
- PigDicesGame: Inherits from
Game<PigDicesPlayer>, implements specific rules for the dice game, such as turns, dice rolls, point management, and player decisions. - PigDicesPlayer: Inherits from
Playerand adds properties related to player scoring. - Currency: Used for storing and manipulating player points.
- Dice: Used for generating dice rolls.
The PigDicesGame class inherits from Game and implements specific rules for the dice game.
- Inherits from:
Game<PigDicesPlayer> - Uses modules:
PigDicesPlayer,Dice,Currency
The PigDicesPlayer class inherits from Player and adds properties and methods for storing and manipulating player points.
- Inherits from:
Player - Additional properties:
_score(an object of classCurrency)
The WarGame class represents a card game where players compete to capture all the cards. The game ends when one player captures all the cards.
- WarGame: Inherits from
Game<WarPlayer>, implements specific rules for the card game, such as turn-taking, card management, and victory conditions. - WarPlayer: Inherits from
Playerand adds properties related to player cards. - WarDeck: Inherits from
StandardDeckand adds methods for shuffling and dealing cards. - StandardCard: Used to represent cards in the deck.
The WarGame class inherits from Game and implements specific rules for the card game.
- Inherits from:
Game<WarPlayer> - Uses modules:
WarPlayer,WarDeck,StandardCard
The WarPlayer class inherits from Player and adds properties and methods for storing and manipulating player cards.
- Inherits from:
Player - Additional properties:
_cards(a vector of pointers toStandardCardobjects)
The WarDeck class inherits from StandardDeck and implements methods for shuffling and dealing cards.
- Inherits from:
StandardDeck - Additional methods:
deal_cards(deals cards between two players)
The PokerGame class represents a classic card game based on betting and strategy. The game ends when one player wins all the chips.
- PokerGame: Implements specific rules for the poker game, such as turn-taking, bet management, and victory conditions.
- PokerPlayer: Adds properties related to player chips and cards.
- PokerTurn: Implements the logic of each poker turn.
- StandardDeck: Used for shuffling and dealing cards.
- StandardCard: Used to represent cards in the deck.
- Currency: Used for handling bet values.
The PokerGame class implements specific rules for the poker game.
- Uses modules:
PokerPlayer,PokerTurn,StandardDeck,StandardCard,Currency
The PokerPlayer class adds properties and methods for storing and manipulating player chips and cards.
- Additional properties:
_balance(an object of classCurrency),_cards(a pair of pointers toStandardCardobjects)
The PokerTurn class implements the logic of each poker turn, including bet management and player interactions.
- Uses modules:
StandardCard,Currency
Who was responsible for what:
Tomasz Okoń https://github.com/Kemo321
- CMake scripts
- Card
- Dice
- War
- War
- Poker
Łukasz Szydlik https://github.com/WARDROK
- Documentation
- Docstrings
- Game
- Player
- ComparableCard
- Pig Dices
- Pig Dices
- Base Game
Dominik Śledziewski https://github.com/Alveaenerle
- UML diagram
- Currency
- StandardCard
- StandardDeck
- Poker