Add implementation of runecrafting skill

This commit is contained in:
Trevor Flynn
2017-12-28 18:41:21 -10:00
committed by Gary Tierney
parent 397d9b2d6a
commit 97896a34a4
8 changed files with 297 additions and 5 deletions
@@ -1,15 +1,14 @@
package org.apollo.game.model.inv;
import com.google.common.base.Preconditions;
import org.apollo.cache.def.ItemDefinition;
import org.apollo.game.model.Item;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Optional;
import org.apollo.cache.def.ItemDefinition;
import org.apollo.game.model.Item;
import com.google.common.base.Preconditions;
/**
* Represents an inventory - a collection of {@link Item}s.
*
@@ -518,6 +517,15 @@ public final class Inventory {
return remove(item.getId(), item.getAmount());
}
/**
* Remove all items with the given {@code id} and return the number of
* items removed.
*
* @param id The id of items to remove.
* @return The amount that was removed.
*/
public int removeAll(int id) { return remove(id, getAmount(id)); }
/**
* Removes all the listeners.
*/