Package dev.twilite.game.loadout
Class EquipmentLoadout
java.lang.Object
dev.twilite.game.loadout.EquipmentLoadout
- All Implemented Interfaces:
Iterable<LoadoutItem>
Item-id based equipment loadout.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(EquipmentSlot slot, int id) Adds a required item for an equipment slot.add(EquipmentSlot slot, int... ids) Adds accepted variant ids for an equipment slot.add(LoadoutItem item) Adds an equipment entry.booleanReturns whether every required entry is worn or carried.static EquipmentLoadoutcreate()Creates an empty equipment loadout.static EquipmentLoadoutcurrent()Creates an equipment loadout from the currently worn equipment.booleanempty()Returns whether no entries have been added.voidequip()Equips any carried items that are not already worn.item(EquipmentSlot slot) Returns the entry assigned to a slot.items()Returns the entries in equipment-slot order.iterator()missing()Returns missing required equipment entries.booleanworn()Returns whether every required entry is worn.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
EquipmentLoadout
public EquipmentLoadout()
-
-
Method Details
-
create
Creates an empty equipment loadout. -
current
Creates an equipment loadout from the currently worn equipment. -
add
Adds an equipment entry. -
add
Adds a required item for an equipment slot. -
add
Adds accepted variant ids for an equipment slot. -
item
Returns the entry assigned to a slot. -
missing
Returns missing required equipment entries. -
available
public boolean available()Returns whether every required entry is worn or carried. -
worn
public boolean worn()Returns whether every required entry is worn. -
equip
public void equip()Equips any carried items that are not already worn. -
empty
public boolean empty()Returns whether no entries have been added. -
items
Returns the entries in equipment-slot order. -
iterator
- Specified by:
iteratorin interfaceIterable<LoadoutItem>
-