Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package inbetweencardgamegui;
- /**
- *
- * @author VIIXIII
- */
- public class Person {
- private String name;
- private double bankroll;
- private double bet;
- private boolean activePlayer;
- final double BUYING_AMOUNT = 20.00;
- public Person(String name, double bankroll) {
- this.name = name;
- this.bankroll = bankroll - BUYING_AMOUNT;
- setActivePlayer(true);
- }
- public String getName() {
- return name;
- }
- public double getBankroll() {
- return bankroll;
- }
- public boolean isActivePlayer() {
- return activePlayer;
- }
- public double getBet() {
- return bet;
- }
- public void setBankroll(double earnings) {
- this.bankroll = bankroll + earnings;
- if(bankroll <= 0)
- setActivePlayer(false);
- setBet(0.0);
- }
- public void setActivePlayer(boolean activePlayer) {
- this.activePlayer = activePlayer;
- }
- public void setBet(double bet) {
- if(bet < bankroll)
- this.bet = bet;
- else {
- System.out.println("All in!!!");
- this.bet = bankroll;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement