Update Player.java
This commit is contained in:
@@ -10,6 +10,7 @@ public class Player {
|
|||||||
private int location = 1;
|
private int location = 1;
|
||||||
private int guns = 3;
|
private int guns = 3;
|
||||||
private int HP = 100;
|
private int HP = 100;
|
||||||
|
private int debt = 0;
|
||||||
|
|
||||||
public Player(){
|
public Player(){
|
||||||
|
|
||||||
@@ -25,6 +26,7 @@ public class Player {
|
|||||||
this.location = player.location;
|
this.location = player.location;
|
||||||
this.guns = player.guns;
|
this.guns = player.guns;
|
||||||
this.HP = player.HP;
|
this.HP = player.HP;
|
||||||
|
this.debt = player.debt;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
@@ -123,11 +125,19 @@ public class Player {
|
|||||||
if (guns >= 0) {
|
if (guns >= 0) {
|
||||||
this.guns = guns;
|
this.guns = guns;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public int getDebt() {
|
||||||
|
return debt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setDebt(int debt) {
|
||||||
|
if (debt >= 0) {
|
||||||
|
this.debt = debt;
|
||||||
|
}
|
||||||
|
|
||||||
public void gameOver() {
|
public void gameOver() {
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
System.out.println("Game over");
|
System.out.println("Game over");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user