Pinochle: Object Oriented in C++
This project is an implementation of the Pinochle card game written in an Object Oriented design and Polymorphic behavior in C++. The project was written as the first part of Organization of Programming Languages course (CMPS-366) at Ramapo college during the Fall 2020 semester.
The project contains 8 different classes. Additionally, the project features a serialization option of saving the game’s state into a file as well as loading a game from a file.
The classes defined for this project are:
- Card class- This class is responsible for the Card objects- a Card contains a type and a suit.
- Deck class- This class is responsible for the deck of the game, it initializes the Deck and sets and holds the trump card.
- Game class- This class is responsible for starting a new game and/or loading an existing game based on the user request.
- Round class- This class is responsible for starting a round, which displays all the players’ information and calls a turn. It also calls the deck class to deal cards at the beginning of the game and after every turn.
- Turn class- This class is responsible for handling a turn, it calls both players to play in the correct order, determines the winner of the turn, and handles the meld in case one is requested.
- Player class- This class, is responsible for performing all the tasks that are related to the player playing its turn. This includes the play functions, meld functions, strategy functions, etc.
- Human class- This class is used for the human player, it is derived from the Player class (using polymorphism), and has the necessary functionalities for the human-related tasks.
- Computer class- This class is for the computer player, it is derived from the Player class (using polymorphism), it has the necessary functionalities for the computer player.
Additional notes:
- The Game rules can be found in the following links-
Full code and documentation can be found on GitHub: