-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContestantInfo.java
More file actions
63 lines (58 loc) · 1.19 KB
/
ContestantInfo.java
File metadata and controls
63 lines (58 loc) · 1.19 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
57
58
59
60
61
62
63
/**
* Lab 8
*
* Class that holds information about a Contestant.
* This information includes the Contestant's region
* and the Contestant's choice of hand to throw.
*
* @author Stephen
* @version 2018-03-12
*/
public class ContestantInfo
{
/**
* The Contestant's region.
*/
private Region region;
/**
* What choice the Contestant will make in Rock-Paper-Scissors.
*/
private HandChoice choice;
/**
* Constructor
*
* @param region The Contestant's region.
* @param choice The Contestant's hand choice.
*/
public ContestantInfo(Region region, HandChoice choice)
{
this.region = region;
this.choice = choice;
}
/**
* Return the region
*
* @return the region.
*/
public Region getRegion()
{
return region;
}
/**
* Return the hand choice
*
* @return the hand choice.
*/
public HandChoice getChoice()
{
return choice;
}
/**
* Return "contestant from <contestant name> throwing <choice>"
*/
@Override
public String toString()
{
return String.format("contestant from %s throwing %s", region, choice);
}
}