InventoryLoadout
A high-level loadout API designed for use in conjunction with banking and resupplying.
ClassRLPlugins API
public class InventoryLoadout extends LoadoutMembers
Constructors
- newInventoryLoadout(String)
Creates a InventoryLoadout.
Methods
- voidadd(LoadoutItem)
Add.
- voidfulfill(EquipmentLoadout)
Adds missing equipment items to this loadout.
- List<LoadoutItem>getRequiredItems()
The required items.
- intgetSlotCount(LoadoutItem)
The slot count.
- intgetUsedSlots()
The used slots.
Inherited from Loadout
- LoadoutItemget(String)
Get.
- List<LoadoutItem>getExcessItems()
The excess items.
- List<ItemEx>getForeignItems()
The foreign items.
- ItemDepletionListenergetItemDepletionListener()
The item depletion listener.
- StringgetName()
The name.
- booleanisFulfilled()
Whether fulfilled.
- Iterator<LoadoutItem>iterator()
Iterator.
- LoadoutItemremove(String)
Remove.
- voidsetItemDepletionListener(ItemDepletionListener)
Sets the item depletion listener.
InventoryLoadout(String)
public InventoryLoadout(String name)Creates a InventoryLoadout.
Parameters
name- Name.
add(LoadoutItem)
public void add(LoadoutItem item)Add.
Parameters
item- Item.
fulfill(EquipmentLoadout)
public void fulfill(EquipmentLoadout equipmentLoadout)Adds missing equipment items to this loadout.
Parameters
equipmentLoadout- The loadout to add from.
getRequiredItems()
public List<LoadoutItem> getRequiredItems()The required items.
getSlotCount(LoadoutItem)
public int getSlotCount(LoadoutItem entry)The slot count.
Parameters
entry- Entry.
getUsedSlots()
public int getUsedSlots()The used slots.
get(String)from Loadout
public LoadoutItem get(String key)Get.
Parameters
key- Key.
getExcessItems()from Loadout
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()from Loadout
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()from Loadout
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()from Loadout
public String getName()The name.
isFulfilled()from Loadout
public boolean isFulfilled()Whether fulfilled.
iterator()from Loadout
public Iterator<LoadoutItem> iterator()Iterator.
remove(String)from Loadout
public LoadoutItem remove(String key)Remove.
Parameters
key- Key.
setItemDepletionListener(ItemDepletionListener)from Loadout
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