Skip to content

Commit

Permalink
Update Player.java
Browse files Browse the repository at this point in the history
  • Loading branch information
sthakulla authored Jun 7, 2018
1 parent 7038ffc commit b1f511d
Showing 1 changed file with 10 additions and 57 deletions.
67 changes: 10 additions & 57 deletions Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



class Player {
abstract class Player {



Expand Down Expand Up @@ -83,7 +83,7 @@ public void makeBet(Scanner scan) {
boolean a = true;



System.out.println("Money Available: "+money);
System.out.print("How much to bet: ");

bet = scan.nextInt();
Expand Down Expand Up @@ -161,23 +161,6 @@ public void makeBet(Scanner scan) {


}



/* public boolean playAgain(Scanner scan) {
String answer;
System.out.print("Play again [y/n]? ");
answer = scan.next();
return answer.equalsIgnoreCase("y");
}*/ //Moving to the game class



public void payment() {

money = money + Wheel.payoff(bet, betType, number);
Expand Down Expand Up @@ -221,46 +204,16 @@ public void addsubMoney(int net) {
money += net;

}
public void addMoney(int mon) {
money+=mon;
count++;
}



public String toString() {

String result = "";

if (count <= 0) {

int result1 = money - record;

System.out.println();

if (result1 > 0) {

System.out.println("---------Congratulations!---------" + name + ", You won..");

result = "Total money won by " + name + " is $" + (result1 - count * initalMoney);

} else if (result1 == 0) {

result = name + " did not win nor did lose..";

} else {

result1 *= -1;

System.out.println("---------Better Luck next time!!--------- " + name);

result = "Total money lost by " + name + " is $" + (result1 + count * initalMoney);

}

}

System.out.println(" Housemoney because of " + name + ":$" + Game.houseMoney);

System.out.println();

return result;
public abstract String printPlayer();


} // method toString


}

0 comments on commit b1f511d

Please sign in to comment.