diff options
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.cpp | 5 |
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) { |
