-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGameManager.h
55 lines (49 loc) · 1.17 KB
/
GameManager.h
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
#pragma once
#include "Renderer.h"
#include "King.h"
#include "Queen.h"
#include "Bishop.h"
#include "Knight.h"
#include "Rook.h"
#include "Pawn.h"
#include "Constants.h"
using namespace con;
class GameManager
{
private:
static Piece* tracker[64];
static Piece* pieces_black[16];
static Piece* pieces_white[16];
static Piece* threats[3];
static int result;
static int turn;
static bool check;
static bool selected;
static bool checkmate;
static bool quit;
static int selected_block;
static int threat_count;
static int LOS[7];
public:
//Initializes board, pieces, positions
static void Init();
/*Main gameloop, calls update, sets private
member "result", returns when match ends*/
static void StartMatch();
static void EndGame();
//Displays result
static void DisplayResult();
static Piece** GetTracker();
private:
//Updates positions
static void UpdateTracker();
static void HandleInput();
static void RefreshScreen();
static void AttemptMove();
static void DeselectBlock();
static void SelectBlock();
static void Compute_LOS(int attacker_pos, int king_pos);
static bool CheckThreats(bool color);
static bool LOS_Breakable();
static bool Checkmate();
};