-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainGame.h
42 lines (37 loc) · 945 Bytes
/
MainGame.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
//
// MainGame.hpp
// connect4
//
// Created by Tyler Small on 4/10/16.
// Copyright © 2016 Tyler Small. All rights reserved.
//
#ifndef MainGame_h
#define MainGame_h
#include <stdio.h>
#include <iostream>
#include "AI.h"
#include "Board.h"
enum class State { PLAYING, EXIT };
class MainGame {
public:
// Runs the main loop
void run();
//
private:
// Initializes the game
bool init();
// Performs a human controlled move
void playerMove(int player);
// Performs an AI move
void aiMove(int player);
// Changes players
void changePlayer();
// Ends a game and prompts for quit or re-try
void endGame(bool wasTie);
// Member Variables
Board connect4 = *(Board*) malloc(sizeof(Board)); ///< The connect 4 board
int currentPlayer; ///< The index of the current player
State gameState; ///< The state of the game
AI ai; ///< The AI player
};
#endif /* MainGame_h */