Summary Files Commits Branches @commit @diff @stats
path: root / Year 1 / Object-oriented Programming / 07-Practice-05.04.2022 / Game.cpp
diff options
context:
space:
mode:
Commit6ec95b5d689aa38b373ef948ba67ba59235c0eb9 (patch)
Author
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-06 10:50:30 +0300
Committer
 Syndamia <kamen.d.mladenov@protonmail.com>
2022-04-06 10:50:30 +0300
Files888b5a8545dd6ce3ca02233f16fafed7f0861cc1 /Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp
uni-projects-6ec95b5d689aa38b373ef948ba67ba59235c0eb9.tar
uni-projects-6ec95b5d689aa38b373ef948ba67ba59235c0eb9.tar.gz
uni-projects-6ec95b5d689aa38b373ef948ba67ba59235c0eb9.zip
Parent30420a6ea65aa58389b9ffa0ba67130de376c079 (diff)
Added GameCase descriptions and a printing function for them
1 files changed, 5 insertions, 0 deletions
-rw-r--r--Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp5
diff --git a/Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp b/Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp
index 14274f9..bbc91b8 100644
--- a/Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp
+++ b/Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp
@@ -28,6 +28,10 @@ void Game::free() {
}
TurnResult Game::turn(double& bet) {
+ std::cout << "Available commands: " << std::endl;
+ for (int i = 0; i < this->caseCount; i++)
+ cases[i].print();
+
std::cout << "Enter command: ";
char buffer;
std::cin >> buffer;
@@ -61,6 +65,7 @@ Game::Game(const GameCase* cases, unsigned casesCount) {
this->cases = new GameCase[casesCount];
for (int i = 0; i < casesCount; i++)
this->cases[i] = cases[i];
+ this->caseCount = casesCount;
}
Game::Game(const Game& other) {