-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPlayer.java
47 lines (39 loc) · 1.1 KB
/
Player.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
public class Player extends PlayerCard {
private final String name;
private Boolean isHiji = false;
private Boolean isChoosingCard = false;
CardDeck deck = new CardDeck();
// Atribut class player
public Player(String name) {
super();
this.name = name;
}
// Method menapatkan nama
public String getName() {
return this.name;
}
// Method mengucapkan Hiji
public void declareHiji() {
if (getCardLeft() != 1) {
System.out.println("Kamu tidak bisa declare Hiji sekarang!");
System.out.println("Kamu mendapatkan penalti 2 kartu dari deck!");
addCard(deck.getCard());
addCard(deck.getCard());
} else {
System.out.println("Declare Hiji Berhasil");
this.isHiji = true;
}
}
public void restartHiji() {
isHiji = false;
}
public Boolean getHiji() {
return isHiji;
}
public void chooseCard() {
isChoosingCard = !isChoosingCard;
}
public Boolean getChooseCardStatus() {
return isChoosingCard;
}
}