Class EquipmentLoadout
- java.lang.Object
-
- org.rspeer.game.config.item.loadout.EquipmentLoadout
-
- All Implemented Interfaces:
Cloneable,Iterable<ItemEntry>,InventoryLoadout
public class EquipmentLoadout extends Object implements InventoryLoadout
-
-
Constructor Summary
Constructors Constructor Description EquipmentLoadout(String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanadd(ItemEntry entry)Adds anItemEntryto the loadoutEquipmentLoadoutclone()EquipmentLoadoutclone(String name)voidequip()ItemEntryget(String key)ItemEntryget(Equipment.Slot slot)ItemQueryResultsgetBagged()Deprecated, for removal: This API element is subject to removal in a future version.StringgetName()Consumer<ItemEntry>getOutOfItemListener()booleanisWorn()Deprecated, for removal: This API element is subject to removal in a future version.Iterator<ItemEntry>iterator()ItemEntryremove(String key)booleanremove(Equipment.Slot slot)voidsetEntries(Map<String,ItemEntry> entries)voidsetOutOfItemListener(Consumer<ItemEntry> outOfItemListener)BackpackLoadouttoBackpackLoadout()BackpackLoadouttoBackpackLoadout(String name)booleanwithdraw()static EquipmentLoadoutworn(String name)-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.rspeer.game.config.item.loadout.InventoryLoadout
applyProvidedSetup, getExcessBackpackEntries, getExcessEntries, getExcessEquipmentEntries, getExcessItems, getInvalidBackpackItems, getInvalidEquipmentItems, getInvalidItems, getIrrelevantItems, getMissing, getMissingBackpackEntries, getMissingBackpackEntries, getMissingEntries, getMissingEntries, getMissingEntries, getMissingEntries, getMissingEquipmentEntries, getMissingEquipmentEntries, getValidBackpackResults, getValidEquipmentResults, getValidResults, isBackpackValid, isBackpackValid, isBagged, isBagged, isEquipmentValid, isEquipmentValid, isInventoryValid, isInventoryValid
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
EquipmentLoadout
public EquipmentLoadout(String name)
-
-
Method Detail
-
worn
public static EquipmentLoadout worn(String name)
-
withdraw
public boolean withdraw()
- Specified by:
withdrawin interfaceInventoryLoadout
-
isWorn
@Deprecated(forRemoval=true) public boolean isWorn()
Deprecated, for removal: This API element is subject to removal in a future version.UseInventoryLoadout.isEquipmentValid()instead.- Returns:
trueif all entries are currently equipped. IfItemEntry.isOptional()is true, it ignores validation for that item
-
getBagged
@Deprecated(forRemoval=true) public ItemQueryResults getBagged()
Deprecated, for removal: This API element is subject to removal in a future version.UseInventoryLoadout.getValidBackpackResults()instead.- Returns:
- A
Listcontaining items from this loadout that are in the backpack
-
equip
public void equip()
-
toBackpackLoadout
public BackpackLoadout toBackpackLoadout()
-
toBackpackLoadout
public BackpackLoadout toBackpackLoadout(String name)
-
get
public ItemEntry get(Equipment.Slot slot)
-
remove
public boolean remove(Equipment.Slot slot)
-
getName
public String getName()
- Specified by:
getNamein interfaceInventoryLoadout- Returns:
- The name of this loadout
-
get
public ItemEntry get(String key)
- Specified by:
getin interfaceInventoryLoadout- Returns:
- An
ItemEntrywith the given key
-
add
public boolean add(ItemEntry entry)
Description copied from interface:InventoryLoadoutAdds anItemEntryto the loadout- Specified by:
addin interfaceInventoryLoadout- Returns:
trueif an item was successfully added to the loadout
-
remove
public ItemEntry remove(String key)
- Specified by:
removein interfaceInventoryLoadout- Returns:
- The removed entry, or null if no ItemEntry matching the key was present
-
getOutOfItemListener
public Consumer<ItemEntry> getOutOfItemListener()
- Specified by:
getOutOfItemListenerin interfaceInventoryLoadout
-
setOutOfItemListener
public void setOutOfItemListener(Consumer<ItemEntry> outOfItemListener)
- Specified by:
setOutOfItemListenerin interfaceInventoryLoadout
-
clone
public EquipmentLoadout clone(String name)
- Specified by:
clonein interfaceInventoryLoadout
-
clone
public EquipmentLoadout clone()
- Specified by:
clonein interfaceInventoryLoadout
-
-