From 01acec2b16fdb298dcd300c5ef169f3b15d814bf Mon Sep 17 00:00:00 2001 From: Nathan Lum <33772546+Templarre@users.noreply.github.com> Date: Fri, 22 Feb 2019 13:28:06 -0700 Subject: [PATCH] Update Player.java --- src/Player.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Player.java b/src/Player.java index 1544158..d4a159d 100644 --- a/src/Player.java +++ b/src/Player.java @@ -10,6 +10,7 @@ public class Player { private int location = 1; private int guns = 3; private int HP = 100; + private int debt = 0; public Player(){ @@ -25,6 +26,7 @@ public class Player { this.location = player.location; this.guns = player.guns; this.HP = player.HP; + this.debt = player.debt; } public String getName() { @@ -123,11 +125,19 @@ public class Player { if (guns >= 0) { this.guns = guns; } + } + public int getDebt() { + return debt; + } + + public void setDebt(int debt) { + if (debt >= 0) { + this.debt = debt; + } public void gameOver() { System.out.flush(); System.out.println("Game over"); } - }