mirror of
https://github.com/coding-horror/basic-computer-games.git
synced 2026-06-27 17:02:53 -07:00
Handle insurance
This commit is contained in:
@@ -64,6 +64,17 @@ public class Player {
|
||||
total = total - currentBet;
|
||||
currentBet = 0;
|
||||
}
|
||||
|
||||
public void recordInsuranceWin() {
|
||||
total = total + (insuranceBet * 2);
|
||||
insuranceBet = 0;
|
||||
}
|
||||
|
||||
public void recordInsuranceLoss() {
|
||||
total = total - insuranceBet;
|
||||
insuranceBet = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the total of all bets won.
|
||||
* @return Total value
|
||||
|
||||
Reference in New Issue
Block a user