-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
45 lines (36 loc) · 923 Bytes
/
main.cpp
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
/*
* Roni Fultheim, ID: 313465965
*
* main.cpp
* Implementation of main function - runs program
*/
#include <iostream>
#include "GameManager.h"
#include "HumanPlayer.h"
#include "StandardMoveLogic.h"
#include "Color.h"
#include <string>
using namespace std;
/**
* Creates a Board initialized by default parameters and prints it
*/
int main() {
//initialize game
cout << "Welcome to Reversi!" << endl;
//dynamically allocate objects of general types on heap
Board* baord = new Board();
Player* player1 = new HumanPlayer("X", Player::ColorOfPlayer::BLACK);
Player* player2 = new HumanPlayer("O", Player::ColorOfPlayer::WHITE);
//allocate on stack
//currently there is only one type of logic - no need to allocate dynamically
StandardMoveLogic ml;
ViewByConsole view;
GameManager gf(board, p1, p2, &ml);
//play game
gf.playGame();
//release memory
delete b;
delete p1;
delete p2;
return 0;
}