-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dealer.java
65 lines (50 loc) · 1.38 KB
/
Dealer.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package blackjack_verkort_tentamen_rob_biemans;
import java.util.ArrayList;
public class Dealer extends Participant {
private Hand h = new Hand(this);
private boolean finished;
private int points;
private ArrayList<ArrayList<String>> handsInfo = new ArrayList<ArrayList<String>>();
public Dealer() {
}
// Create hands (in Hand)
public void createHands() {
h.CreateDealerHandwithCards();
}
public void giveDealerCard() {
h.giveDealerCard();
ArrayList<String> status = new ArrayList<String>();
status.add("none");
this.handsInfo.add(status);
this.setHandenInfo(handsInfo);
}
public void setFinished(boolean value) {
this.finished = value;
}
public boolean getFinished() {
return finished;
}
public void setPoints(int value) {
this.points = value;
}
public int getPoints() {
return points;
}
public void updateHandDeath() {
ArrayList<String> status = new ArrayList<String>();
status.add("Dood");
this.handsInfo.set(0, status);
}
// return ArrayList with hands
public ArrayList<ArrayList<String>> getHandenInfo() {
return handsInfo;
}
// Get hands (from Hand)
// Add the hands to the player his hands array
public void setHandenInfo(ArrayList<ArrayList<String>> value) {
this.handsInfo.addAll(value);
}
public void resetHandInfo() {
this.handsInfo.clear();
}
}