|
@ -8,6 +8,10 @@ import java.util.ArrayList; |
|
|
public class Player { |
|
|
public class Player { |
|
|
private String name; |
|
|
private String name; |
|
|
private float hp; |
|
|
private float hp; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private float gold; |
|
|
private Location location; |
|
|
private Location location; |
|
|
|
|
|
|
|
|
private ArrayList<Item> inventory; |
|
|
private ArrayList<Item> inventory; |
|
@ -20,6 +24,7 @@ public class Player { |
|
|
hp = 100.0F; |
|
|
hp = 100.0F; |
|
|
location = new Location(jp.getJSONObject("playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>()); |
|
|
location = new Location(jp.getJSONObject("playerconfig.json").getString("currentLocation"), new ArrayList<>(), new ArrayList<>()); |
|
|
inventory = new ArrayList<>(); |
|
|
inventory = new ArrayList<>(); |
|
|
|
|
|
gold = jp.getJSONObject("playerconfig.json").getFloat("gold"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String getName() { |
|
|
public String getName() { |
|
@ -58,4 +63,8 @@ public class Player { |
|
|
this.name = name; |
|
|
this.name = name; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public float getGold() { return gold; } |
|
|
|
|
|
|
|
|
|
|
|
public void setGold(float gold) { this.gold = gold; } |
|
|
|
|
|
|
|
|
} |
|
|
} |