-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSingle.java
More file actions
36 lines (31 loc) · 724 Bytes
/
Copy pathSingle.java
File metadata and controls
36 lines (31 loc) · 724 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
/**
* Single class is a subclass of Hand which model a single hand
* and implement the method in Hand
*
* @author Chan Yuk Yin (UID: 3035786574)
*/
public class Single extends Hand{
// Public constructor of Single
public Single(CardGamePlayer player, CardList cards){
super(player, cards);
}
/**
* Check whether it is a valid single hand
* @return boolean
*/
public boolean isValid(){
if (!this.isEmpty()){
if (this.size() == 1){
return true;
}
}
return false;
}
/**
* Return type of hand
* @return String
*/
public String getType(){
return "Single";
}
}