From 6ec95b5d689aa38b373ef948ba67ba59235c0eb9 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Wed, 6 Apr 2022 10:50:30 +0300 Subject: Added GameCase descriptions and a printing function for them --- Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'Year 1/Object-oriented Programming/07-Practice-05.04.2022/Game.cpp') 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) { -- cgit v1.3.1-23-gd82d