diff --git a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Inventory.java b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Inventory.java index 28b589a..cf1bbbd 100644 --- a/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Inventory.java +++ b/src/main/java/uulm/teamname/marvelous/gamelibrary/entities/Inventory.java @@ -80,6 +80,16 @@ public class Inventory implements Iterable { content.remove(stone); } + /** Returns the stones inside of the Inventory as Array of {@link StoneType StoneTypes} */ + public StoneType[] getStonesAsArray() { + var toReturn = new StoneType[content.size()]; + var iterator = content.iterator(); + for (int i = 0; i < content.size(); i++) { + toReturn[i] = iterator.next(); + } + return toReturn; + } + /** Iterates over the inventory. */ @Override public Iterator iterator() {