-
Notifications
You must be signed in to change notification settings - Fork 0
/
Participant.java
47 lines (34 loc) · 1004 Bytes
/
Participant.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
37
38
39
40
41
42
43
44
45
46
47
package blackjack_verkort_tentamen_rob_biemans;
import java.util.ArrayList;
public class Participant {
// Declarations
private String name;
private ArrayList<ArrayList<Card>> handArrayList = new ArrayList<ArrayList<Card>>();
// Constructor
public Participant() {
}
public String getName() {
return name;
}
public void setName(String input) {
this.name = input;
}
// return ArrayList with hands
public ArrayList<ArrayList<Card>> getHanden() {
return handArrayList;
}
// Get hands (from Hand)
// Add the hands to the player his hands array
public void setHanden(ArrayList<ArrayList<Card>> value) {
this.handArrayList.addAll(value);
}
public void addCardToHand(int value, ArrayList<Card> deck) {
this.handArrayList.get(value).addAll(deck);
}
public void addCardToDealerHand(ArrayList<Card> deck) {
this.handArrayList.get(0).addAll(deck);
}
public void clearHands() {
this.handArrayList.clear();
}
}