package main; import java.util.TreeSet; public class Location { private Tile ground; private Tile base; private TreeSet creatures; private TreeSet objects; private TreeSet items; public boolean passable; public int obstacles; public Location(final Tile ground) { this.ground = ground; this.objects = new TreeSet(); this.creatures = new TreeSet(); this.items = new TreeSet(); this.passable = true; this.obstacles = 0; } public Tile getGround() { return this.ground; } public Tile getBase() { return this.base; } public Tile getStructure() { return this.base; } public void addObject(final Tile obj) { this.objects.add(obj); } public TreeSet getObjects() { return this.objects; } public void addCreature(final Creature creature) { this.creatures.add(creature); } public TreeSet getCreatures() { return this.creatures; } public void addItem(final Item item) { this.items.add(item); } public TreeSet getItems() { return this.items; } public void setGround(final Tile ground) { if (ground.getImg().needsBase()) { if (this.ground.getImg().needsBase()) { this.ground = ground; } else { this.base = this.ground; this.ground = ground; } } else { this.base = null; this.ground = ground; } } }