-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardType.java
36 lines (35 loc) · 901 Bytes
/
CardType.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
public enum CardType {
BANG,
MISSED,
BEER,
CAT_BALOU,
STAGECOACH,
INDIANS,
JAIL,
DYNAMITE,
BARREL;
public static CardType getCardType(String card) {
switch (card) {
case "Bang":
return BANG;
case "Missed":
return MISSED;
case "Beer":
return BEER;
case "Cat Balou":
return CAT_BALOU;
case "Stagecoach":
return STAGECOACH;
case "Indians":
return INDIANS;
case "Jail":
return JAIL;
case "Dynamite":
return DYNAMITE;
case "Barrel":
return BARREL;
default:
throw new IllegalArgumentException("Invalid card type: " + card);
}
}
}