-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGame.java
More file actions
56 lines (56 loc) · 1.25 KB
/
Game.java
File metadata and controls
56 lines (56 loc) · 1.25 KB
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
56
Public class Game {
Private Board board;
Private String userMove;
Private User storeplayerOne;
Private int PlayerOnePasses;
Private int PlayerTwoPasses;
Private User storeplayerTwo;
Private String gameID;
Private String Winner;
Private String Loser;
Public Game (){
}
Public String placeStone (int x, int y) {
If (UserMove.equals(“P1”)){
return Board.placeStone(“P1”, x, y);
} else {
return Board.placeStone(“P2”, x, y);
}
}
Public String checkPasses (player1, Player2) {
If (PlayerOnePasses >= 3) {
Return “Player one reached 3 passes”;
}
If (PlayerTwoPasses >= 3) {
Return “Player two reached 3 passes”;
}
Public boolean selectPlayerOne (User P1){
This.storeplayerOne = P1;
}
Public Boolean selectPlayerTwo (User P2){
This.storeplayerTwo = P2;
}
Public User GetplayerOne {
Return This.storePlayerOne;
}
Public User GetPlayerTwo{
Return This.storePlayerTwo;
}
Public String GetgameID () {
Return this.gameID;
}
Public void SetgameID(String GameID){
This.gameID == GameID;
}
Public String GetWinner(){
Return this.winner;
}
Public String GetLoser(){
Return this.loser;
}
Public void setWinner(String Winner){
This.Winner == Winner;
}
Public void setLoser(String Loser){
This.Loser == Loser;
}