|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrlgamekit.equipment.Equipment<E>
public class Equipment<E>
Equipment collection for player and non-player characters. Slots can be guarded by constraints.
EquipmentListener,
Constraint| Field Summary | |
|---|---|
java.lang.String[] |
slotNames
Each slot can have a name. |
| Constructor Summary | |
|---|---|
Equipment(java.lang.String[] slotNames)
Create a new equipment structure. |
|
| Method Summary | |
|---|---|
void |
addListener(EquipmentListener l)
Add a listener to be called upon equipment changes. |
E |
getItem(int slot)
Get the item from a particular equipment slot. |
void |
removeListener(EquipmentListener l)
Remove a listener from the listener list. |
void |
setConstraint(int slot,
Constraint<E> constraint)
Set a constraint for an equipment slot. |
boolean |
setItem(int slot,
E item)
Try to place an item into an equipment slot. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String[] slotNames
| Constructor Detail |
|---|
public Equipment(java.lang.String[] slotNames)
slotNames - Array with all slot names.| Method Detail |
|---|
public E getItem(int slot)
slot - The slot
public boolean setItem(int slot,
E item)
slot - The slotitem - The item
public void setConstraint(int slot,
Constraint<E> constraint)
slot - The slotconstraint - The constraintpublic void addListener(EquipmentListener l)
l - The listener to add.public void removeListener(EquipmentListener l)
l - The listener to remove.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||