-
Notifications
You must be signed in to change notification settings - Fork 1
/
Player.java
48 lines (39 loc) · 932 Bytes
/
Player.java
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
/*
* Player.java
*
* Name: Javier Chavez
* Email: [email protected]
* Sept. 4 2013
* CS 251 Lab 2
*
*/
import cs251.lab2.GomokuModel;
import cs251.lab2.GomokuModel.Outcome;
import cs251.lab2.GomokuModel.Square;
public class Player{
private Square symbol;
private boolean isComputer;
public Player(Square s, boolean c) {
this.setComputer(c);
this.setSymbol(s);
}
public Outcome getOutcome(){
if (getSymbol() == GomokuModel.Square.CROSS) {
return Outcome.CROSS_WINS;
} else {
return Outcome.RING_WINS;
}
}
public boolean isComputer() {
return isComputer;
}
public void setComputer(boolean isComputer) {
this.isComputer = isComputer;
}
public Square getSymbol() {
return symbol;
}
private void setSymbol(Square symbol) {
this.symbol = symbol;
}
}