-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameManager.h
More file actions
64 lines (47 loc) · 1.22 KB
/
Copy pathGameManager.h
File metadata and controls
64 lines (47 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#pragma once
#include "Board.h"
#include "Piece.cpp"
#include "Pawn.h"
#include "Knight.h"
#include "Bishop.h"
#include "Rook.h"
#include "Queen.h"
#include "King.h"
#include "Player.h"
#include "NotationManager.h"
#include "Utilz.h"
#include <typeinfo>
#include <iostream>
#include <SFML/Graphics.hpp>
using namespace Utilz;
/// <summary>
/// Manages all the aspects of this game
/// </summary>
class GameManager
{
public:
GameManager(); // Constructor for the Game Manager
~GameManager();
void Update(sf::RenderWindow& window);
private:
Board<Piece> board; // the Board
Player* players[2] = { nullptr, nullptr };
Player* current = nullptr;
enum status {
ONGOING,
DRAW,
CHECKMATE
};
status game = ONGOING;
NotationManager* printer = nullptr;
size_t turn = 0; // Number of turns
bool gameOver = false;
void DrawScreen(sf::RenderWindow& window);
void DrawBackground(sf::RenderWindow& window) const;
void DrawBoard(sf::RenderWindow& window);
void DrawPieces(sf::RenderWindow& window) const;
void DrawText(std::string text, sf::Font font, sf::RenderWindow& window) const;
void DrawCapturedPieces(sf::RenderWindow& window) const;
bool Checkmate(sf::RenderWindow& window);
bool Draw(sf::RenderWindow& window);
};