-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReferee.java
More file actions
45 lines (42 loc) · 954 Bytes
/
Copy pathReferee.java
File metadata and controls
45 lines (42 loc) · 954 Bytes
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
/**
* Referee class for overseeing the tic tac toe game, and initializing
* the start of the game (setting player 1 and player 2) and displaying board
*/
public class Referee {
private Player xPlayer;
private Player oPlayer;
private Board board;
private MainGUI gui;
/**
* default constructor for Referee Class
*/
public Referee() {}
/**
* Method for starting the first run of the year
*/
void runTheGame() {
xPlayer.setOpponent(oPlayer);
oPlayer.setOpponent(xPlayer);
}
/**
* setter method for game board
* @param board: represents state of board
*/
void setBoard(Board board) {
this.board = board;
}
/**
* setter method for player o
* @param oPlayer: represents player with mark O
*/
void setoPlayer(Player oPlayer) {
this.oPlayer = oPlayer;
}
/**
* setter method for player x
* @param xPlayer: represents player with mark X
*/
void setxPlayer(Player xPlayer) {
this.xPlayer = xPlayer;
}
}