Loadout
Items you want carried, worn or banked, and whether you have them.
Abstract classRLPlugins API
public abstract class Loadout implements Iterable<LoadoutItem>Extended by EquipmentLoadout, InventoryLoadout
Members
Constructors
- newLoadout(String)
Creates a Loadout.
Methods
- voidadd(LoadoutItem)
Add.
- LoadoutItemget(String)
Get.
- List<LoadoutItem>getExcessItems()
The excess items.
- List<ItemEx>getForeignItems()
The foreign items.
- ItemDepletionListenergetItemDepletionListener()
The item depletion listener.
- StringgetName()
The name.
- List<LoadoutItem>getRequiredItems()
The required items.
- booleanisFulfilled()
Whether fulfilled.
- Iterator<LoadoutItem>iterator()
Iterator.
- LoadoutItemremove(String)
Remove.
- voidsetItemDepletionListener(ItemDepletionListener)
Sets the item depletion listener.
Loadout(String)
public Loadout(String name)Creates a Loadout.
Parameters
name- Name.
add(LoadoutItem)
public abstract void add(LoadoutItem item)Add.
Parameters
item- Item.
get(String)
public LoadoutItem get(String key)Get.
Parameters
key- Key.
getExcessItems()
public List<LoadoutItem> getExcessItems()The excess items.
Returns
A List of items that are not foreign to this loadout, but are present in excess quantities.
getForeignItems()
public List<ItemEx> getForeignItems()The foreign items.
Returns
A List of foreign items that are currently in the inventory, or equipment if this is an EquipmentLoadout. A foreign item includes anything that isn't in this loadout.
getItemDepletionListener()
public ItemDepletionListener getItemDepletionListener()The item depletion listener.
Returns
A listener to trigger when an item is attempted to be interacted with but is not available or in the desired quantity. This can be utilised to trigger states in your plugin such as restocking.
getName()
public String getName()The name.
getRequiredItems()
public abstract List<LoadoutItem> getRequiredItems()The required items.
Returns
A List containing the remainder of items that we still need. For EquipmentLoadout, an item is marked as not required if it is either in the inventory, or equipment.
isFulfilled()
public boolean isFulfilled()Whether fulfilled.
iterator()
public Iterator<LoadoutItem> iterator()Iterator.
remove(String)
public LoadoutItem remove(String key)Remove.
Parameters
key- Key.
setItemDepletionListener(ItemDepletionListener)
public void setItemDepletionListener(ItemDepletionListener itemDepletionListener)Sets the item depletion listener.
Parameters
itemDepletionListener- Item depletion listener.
Also allowed
Every class has these, as in plain Java.
equals, forEach, toString