OGS Java API Spec

ogs.core
Class BodyPart

java.lang.Object
  |
  +--ogs.core.BodyPart

public class BodyPart
extends Object

A part of the body where items can be equipped. An eqipped item is worn, held, or used somehow. The body part determines how many items can be equipped and how they are equipped. A normal human hand for example can wear one glove, five rings, and hold one item. This class defines humanoid body parts. Body parts of other creatures (such as tails, wings, horns, whatever) may be defined by other classes.


Field Summary
static byte ARMS
           
static byte BACK
           
static byte EYES
           
static byte HANDS
           
static byte HEAD
           
static byte LEFT_ARM
           
static byte LEFT_EYE
           
static byte LEFT_FOOT
           
static byte LEFT_HAND
           
static byte LEFT_LEG
           
static byte LEGS
           
static byte NECK
           
static byte RIGHT_ARM
           
static byte RIGHT_EYE
           
static byte RIGHT_FOOT
           
static byte RIGHT_HAND
           
static byte RIGHT_LEG
           
static byte TORSO
           
static byte WAIST
           
 
Constructor Summary
BodyPart(Creature creature, byte type)
          Create a new body part.
 
Method Summary
 boolean dropItem(Item item)
          Drop an item from this body part.
 boolean equipItem(Item item)
          Equip an item on this body part.
 Creature getCreature()
          Determine the creature that this body part belongs to.
 Collection getItems()
          Determine the equipped items for this body part.
 byte getType()
          Determine the type of this body part.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HEAD

public static final byte HEAD
See Also:
Constant Field Values

EYES

public static final byte EYES
See Also:
Constant Field Values

LEFT_EYE

public static final byte LEFT_EYE
See Also:
Constant Field Values

RIGHT_EYE

public static final byte RIGHT_EYE
See Also:
Constant Field Values

NECK

public static final byte NECK
See Also:
Constant Field Values

TORSO

public static final byte TORSO
See Also:
Constant Field Values

BACK

public static final byte BACK
See Also:
Constant Field Values

ARMS

public static final byte ARMS
See Also:
Constant Field Values

LEFT_ARM

public static final byte LEFT_ARM
See Also:
Constant Field Values

RIGHT_ARM

public static final byte RIGHT_ARM
See Also:
Constant Field Values

HANDS

public static final byte HANDS
See Also:
Constant Field Values

LEFT_HAND

public static final byte LEFT_HAND
See Also:
Constant Field Values

RIGHT_HAND

public static final byte RIGHT_HAND
See Also:
Constant Field Values

WAIST

public static final byte WAIST
See Also:
Constant Field Values

LEGS

public static final byte LEGS
See Also:
Constant Field Values

LEFT_LEG

public static final byte LEFT_LEG
See Also:
Constant Field Values

RIGHT_LEG

public static final byte RIGHT_LEG
See Also:
Constant Field Values

LEFT_FOOT

public static final byte LEFT_FOOT
See Also:
Constant Field Values

RIGHT_FOOT

public static final byte RIGHT_FOOT
See Also:
Constant Field Values
Constructor Detail

BodyPart

public BodyPart(Creature creature,
                byte type)
Create a new body part. The type of body part does not have to be one of the predefined humanoid body parts. It can be any body part specific to a particular creature such as tails, wings, horns, or whatever. The type value of the body part however must not conflict with one of the predefined types. The new body part has not equipped items.

Parameters:
creature - Creature that this body part belongs to.
type - Type of body part.
Method Detail

getCreature

public Creature getCreature()
Determine the creature that this body part belongs to.

Returns:
Creature that this body part belongs to.

getType

public byte getType()
Determine the type of this body part.

Returns:
Type of body part.

getItems

public Collection getItems()
Determine the equipped items for this body part.

Returns:
An array of equipped items for this body part.

equipItem

public boolean equipItem(Item item)
Equip an item on this body part. If the item cannot be equipped, this function will return false.

Parameters:
item - Item to be equipped on this body part.
Returns:
True if item is equipped on this body part.

dropItem

public boolean dropItem(Item item)
Drop an item from this body part. If the item cannot be dropped (maybe it is cursed or grafted onto the body part), this function will return false.

Returns:
True if item is dropped from this body part.

OGS Java API Spec