-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathResult.java
More file actions
37 lines (32 loc) · 745 Bytes
/
Result.java
File metadata and controls
37 lines (32 loc) · 745 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
/**
* Class to represent the result of an action in a fight.
*
* @author Thomas Vakili
* @version 2013.14.15
*/
public class Result {
String representation;
Character winner;
Character loser;
public Result(String representation, Character winner, Character loser) {
this.representation = representation;
this.winner = winner;
this.loser = loser;
}
/**
* Return whether or not the fight has ended.
*/
public boolean fightOver() {
return winner != null;
}
@Override
public String toString(){
return representation;
}
public Character getWinner() {
return winner;
}
public Character getLoser() {
return loser;
}
}