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 boolean
add(ItemEntry entry)
Adds anItemEntry
to the loadoutEquipmentLoadout
clone()
EquipmentLoadout
clone(String name)
void
equip()
ItemEntry
get(String key)
ItemEntry
get(Equipment.Slot slot)
ItemQueryResults
getBagged()
Deprecated, for removal: This API element is subject to removal in a future version.String
getName()
Consumer<ItemEntry>
getOutOfItemListener()
boolean
isWorn()
Deprecated, for removal: This API element is subject to removal in a future version.Iterator<ItemEntry>
iterator()
ItemEntry
remove(String key)
boolean
remove(Equipment.Slot slot)
void
setEntries(Map<String,ItemEntry> entries)
void
setOutOfItemListener(Consumer<ItemEntry> outOfItemListener)
BackpackLoadout
toBackpackLoadout(String name)
boolean
withdraw()
static EquipmentLoadout
worn(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:
withdraw
in 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:
true
if 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
List
containing items from this loadout that are in the backpack
-
equip
public void equip()
-
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:
getName
in interfaceInventoryLoadout
- Returns:
- The name of this loadout
-
get
public ItemEntry get(String key)
- Specified by:
get
in interfaceInventoryLoadout
- Returns:
- An
ItemEntry
with the given key
-
add
public boolean add(ItemEntry entry)
Description copied from interface:InventoryLoadout
Adds anItemEntry
to the loadout- Specified by:
add
in interfaceInventoryLoadout
- Returns:
true
if an item was successfully added to the loadout
-
remove
public ItemEntry remove(String key)
- Specified by:
remove
in interfaceInventoryLoadout
- Returns:
- The removed entry, or null if no ItemEntry matching the key was present
-
getOutOfItemListener
public Consumer<ItemEntry> getOutOfItemListener()
- Specified by:
getOutOfItemListener
in interfaceInventoryLoadout
-
setOutOfItemListener
public void setOutOfItemListener(Consumer<ItemEntry> outOfItemListener)
- Specified by:
setOutOfItemListener
in interfaceInventoryLoadout
-
clone
public EquipmentLoadout clone(String name)
- Specified by:
clone
in interfaceInventoryLoadout
-
clone
public EquipmentLoadout clone()
- Specified by:
clone
in interfaceInventoryLoadout
-
-