feat: add thanos' ai
This commit is contained in:
@ -80,7 +80,10 @@ public class Inventory implements Iterable<StoneType> {
|
||||
content.remove(stone);
|
||||
}
|
||||
|
||||
/** Returns the stones inside of the Inventory as Array of {@link StoneType StoneTypes} */
|
||||
/**
|
||||
* Returns the stones inside of the Inventory as Array of {@link StoneType StoneTypes}.
|
||||
* @return The array of stones the inventory has
|
||||
*/
|
||||
public StoneType[] getStonesAsArray() {
|
||||
var toReturn = new StoneType[content.size()];
|
||||
var iterator = content.iterator();
|
||||
@ -90,6 +93,17 @@ public class Inventory implements Iterable<StoneType> {
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transfers the stones inside of the Inventory to a different Inventory.
|
||||
* @param to The {@link Inventory} to transfer to
|
||||
*/
|
||||
public void transfer(Inventory to) {
|
||||
for(StoneType stone: content) {
|
||||
to.addStone(stone);
|
||||
}
|
||||
content.clear();
|
||||
}
|
||||
|
||||
/** Iterates over the inventory. */
|
||||
@Override
|
||||
public Iterator<StoneType> iterator() {
|
||||
|
@ -20,7 +20,7 @@ public class NPC extends Entity {
|
||||
*/
|
||||
public NPC(EntityID id, IntVector2 position, int maxMP, ArrayList<StoneType> inventory) {
|
||||
super(id, position);
|
||||
solid = false;
|
||||
solid = true;
|
||||
opaque = true;
|
||||
this.inventory = new Inventory(inventory);
|
||||
this.mp = new Stat(StatType.MP, maxMP);
|
||||
|
Reference in New Issue
Block a user