-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnonclient class 3
More file actions
42 lines (41 loc) · 879 Bytes
/
Copy pathnonclient class 3
File metadata and controls
42 lines (41 loc) · 879 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
38
39
40
41
42
/******************************************************************************
Eric Zhang
Comp Sci 3
May 13, 2021
Card games Program
*******************************************************************************/
import java.util.ArrayList;
public class Hand
{
private ArrayList <Card> hand;
public Hand ()
{
hand = new ArrayList <Card> ();
}
public void addCard (Card card)
{
hand.add (card);
}
public void removeCard (int num)
{
hand.remove (num);
}
public void removeCard (Card temp)
{
hand.remove (temp);
}
public void clearHand ()
{
hand.clear();
}
//Get a card from the hand
public Card getCard (int cardNum)
{
return hand.get(cardNum);
}
//Get the size of the hand
public int getSize ()
{
return hand.size();
}
}