Study Dungeon  1.0.0
A group project for COSC345
game_scene.h
Go to the documentation of this file.
1 
11 #pragma once
12 #ifndef GAME_SCENE_H
13 #define GAME_SCENE_H
14 
15 #include "gameloop.h"
16 #include "menu.h"
17 #include "player.h"
18 #include "util.h"
19 #include <conio.h>
20 
22 const int user_deck_size{60};
24 const int bot_deck_size{60};
26 const int user_hand_size{5};
28 const int bot_hand_size{5};
29 
35 {
36 private:
38  ConsoleUI::UIManager &m_uiManager;
40  bool m_needsRedraw = true;
42  int m_selectedIndex = 0;
44  std::function<void()> m_goBack;
46  Game game;
48  std::vector<PlayingCard> playlist;
50  bool m_staticDrawn = false;
51 
52 public:
59  GameScene(ConsoleUI::UIManager &uiManager, std::function<void()> goBack);
60 
65  void update() override;
66 
71  void init() override;
72 
78  void render(std::shared_ptr<ConsoleUI::ConsoleWindow> window) override;
79 
84  void handleInput() override;
85 
90  void setStaticDrawn(bool staticDrawn) override;
91 };
92 
93 #endif
Defines a UI scene.
Definition: menu.h:629
Defines the UI manager.
Definition: menu.h:675
Scene for the card duel game.
Definition: game_scene.h:35
GameScene(ConsoleUI::UIManager &uiManager, std::function< void()> goBack)
Construct a new Game Scene object.
Definition: game_scene.cpp:13
void render(std::shared_ptr< ConsoleUI::ConsoleWindow > window) override
render the scene
Definition: game_scene.cpp:42
void handleInput() override
handle the input for the scene
Definition: game_scene.cpp:136
void update() override
update the scene
Definition: game_scene.cpp:22
void init() override
initialise the scene
Definition: game_scene.cpp:26
void setStaticDrawn(bool staticDrawn) override
Sets the static drawn state of the scene.
Definition: game_scene.cpp:36
Represents a Game.
Definition: gameloop.h:30
const int user_hand_size
Definition: game_scene.h:26
const int bot_hand_size
Definition: game_scene.h:28
const int bot_deck_size
Definition: game_scene.h:24
const int user_deck_size
Definition: game_scene.h:22
Controls the game play and game loop of the card duel game.
Classes and functions for the UI system.
This file defines the classes and methods for a Player.
Contains useful helper functions.