Handle insurance

This commit is contained in:
Dave Burke
2022-03-04 13:02:26 -06:00
parent 375f16c4a8
commit 84a70ad1ff
2 changed files with 46 additions and 18 deletions
+11
View File
@@ -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