-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatistics.java
More file actions
32 lines (28 loc) · 992 Bytes
/
Statistics.java
File metadata and controls
32 lines (28 loc) · 992 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
public class Statistics {
int sWins = 0, fWins = 0;
int fBegin = 0, sBegin = 0;
public void addGame(Game game) {
if (game.isFinished()) {
if (game.getWinner().equals(Game.fBot)) {
fWins++;
} else {
sWins++;
}
}
MainPanel.showWins(fWins, sWins);
}
public void beginner(Bot bot) {
if (bot.equals(Game.fBot)) {
fBegin++;
} else {
sBegin++;
}
}
public void output() {
MainPanel.showWins(fWins, sWins);
System.out.println(Game.fBot.getName() + " has won " + fWins + " times.");
System.out.println(Game.sBot.getName() + " has won " + sWins + " times.");
System.out.println(Game.fBot.getName() + " has started the game " + fBegin + " times.");
System.out.println(Game.sBot.getName() + " has started the game " + sBegin + " times.");
}
}