diff --git a/src/main/java/org/bitbiome/classes/Player.java b/src/main/java/org/bitbiome/classes/Player.java new file mode 100644 index 0000000..1090d7e --- /dev/null +++ b/src/main/java/org/bitbiome/classes/Player.java @@ -0,0 +1,51 @@ +package org.bitbiome.classes; + +import java.util.ArrayList; + +public class Player { + private String name; + private float hp; + private Location location; + + private ArrayList inventory; + + public Player(String name) { + this.name = name; + hp = 100.0F; + location = CreateLocations.createForest(); + inventory = new ArrayList<>(); + } + + public String getName() { + return name; + } + + public ArrayList getInventory() { + return inventory; + } + + public float getHp() { + return hp; + } + + public Location getLocation() { + return location; + } + + public void setLocation(Location location) { + this.location = location; + } + + public void setHp(float hp) { + this.hp = hp; + } + + public boolean addToInventory(Item item) { + return inventory.add(item); + } + + public boolean removeFromInventory(Item item) { + return inventory.remove(item); + } + +}