|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is shared by things that have body parts that can serve as slots for weapons and armor.
Method Summary | |
void |
addPart(BodyPart part)
Adds the specified body-part to the list. |
void |
addPartFirst(BodyPart part)
Adds the specified body-part to the front of the list. |
BodyPart |
chooseRandomPart()
Asks for a body-part to use as a hit location, computed using the relative "weight" (size) of each body part. |
BodyPart |
find(GenericPredicate p)
Iterates over the parts, looking for one that satisfies the passed predicate. |
BodyPart |
get(int index)
Returns the part at the specified index, or null if the index is out of bounds. |
BodyPart |
getByHashcode(int hashcode)
Retrieves a part from the list by its hashcode. |
java.util.List |
getParts()
Returns the underlying list of parts in this body. |
boolean |
isEmpty()
Returns true if there are no parts in the list. |
java.util.Iterator |
iterator()
Returns an iterator over the parts-list. |
void |
removePart(BodyPart part)
Removes the specified body-part from the list. |
int |
size()
Returns the number of items in the list. |
Method Detail |
public BodyPart getByHashcode(int hashcode)
public void addPart(BodyPart part)
public void addPartFirst(BodyPart part)
public void removePart(BodyPart part)
public BodyPart find(GenericPredicate p)
p
- the Predicate functionpublic java.util.Iterator iterator()
public BodyPart get(int index)
public boolean isEmpty()
public int size()
public java.util.List getParts()
public BodyPart chooseRandomPart()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |