-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathPlayer.java
More file actions
58 lines (44 loc) · 1.2 KB
/
Player.java
File metadata and controls
58 lines (44 loc) · 1.2 KB
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
package Domain;
import java.util.List;
public class Player extends Participant{
public String playerResult = "";
public int bettingPrice = 0 ;
public Player(String name, List<TrumpCard> ParticipantCardList) {
super(name, ParticipantCardList);
}
public boolean isPlayerWin(int dealerScore){
int myScore = getParticipantScore();
if(myScore > 21){
return false;
}
if(dealerScore > 21){
return true;
}
return dealerScore < myScore;
}
public float isPlayerWin_2(int dealerScore, boolean isDealerBlackJack, boolean isPlayerBlackJack){
int myScore = getParticipantScore();
if(myScore > 21){
return -1;
}
if(dealerScore > 21){
return 1;
}
if(isDealerBlackJack && isPlayerBlackJack){
return 1 ;
}
if(isPlayerBlackJack){
return 1.5f ;
}
if(dealerScore < myScore){
return 1 ;
}
if(dealerScore == myScore){ // 동점인 경우, 수익 0
return 0 ;
}
return -1;
}
public void setPlayerResult(){
playerResult = "승";
}
}