Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   Related Pages  

ogs::core::BodyPart Class Reference

A part of the body where items can be equipped. More...

#include <BodyPart.h>

Inheritance diagram for ogs::core::BodyPart:

Inheritance graph
[legend]
Collaboration diagram for ogs::core::BodyPart:

Collaboration graph
[legend]
List of all members.

Public Types

typedef std::list< ItemPtrItems
 A list of items.

enum  Type {
  HEAD = 1, EYES, LEFT_EYE, RIGHT_EYE,
  NECK, TORSO, BACK, ARMS,
  LEFT_ARM, RIGHT_ARM, HANDS, LEFT_HAND,
  RIGHT_HAND, WAIST, LEGS, LEFT_LEG,
  RIGHT_LEG, LEFT_FOOT, RIGHT_FOOT
}
 A type of body part. More...


Public Member Functions

 BodyPart (Creature &creature, Type type)
 Create a new body part.

CreaturegetCreature () const
 Determine the creature that this body part is part of.

Type getType () const
 Determine the type of this body part.

Items getItems () const
 Determine the equipped items for this body part.

bool equipItem (Item &item)
 Equip an item on this body part.

bool unequipItem (Item &item)
 Remove an equipped or carried item from this body part.


Detailed Description

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 cclass predefines humanoid body parts. Body parts of other creatures (such as tails, wings, horns, whatever) may be defined by other classes.


Member Typedef Documentation

typedef std::list<ItemPtr> ogs::core::BodyPart::Items
 

The list represents the items equipped or carried on this part of the body.


Member Enumeration Documentation

enum ogs::core::BodyPart::Type
 

This enumeration defines the omnipresent humanoid body parts. 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


Constructor & Destructor Documentation

ogs::core::BodyPart::BodyPart Creature creature,
Type  type
[inline]
 

The body part has no items when initially created.

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


Member Function Documentation

bool BodyPart::equipItem Item item  ) 
 

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.
Todo:
Implement this function.

Creature & ogs::core::BodyPart::getCreature  )  const [inline]
 

Returns:
Creature that this body part is part of.

BodyPart::Items ogs::core::BodyPart::getItems  )  const [inline]
 

Returns:
A list of equipped items for this body part.

BodyPart::Type ogs::core::BodyPart::getType  )  const [inline]
 

Returns:
Type of body part.

bool BodyPart::unequipItem Item item  )  [inline]
 

Parameters:
item An item to be unequipped from this body part.
Returns:
True if item is unequipped from this body part.
Todo:
Implement this function.


The documentation for this class was generated from the following files:
Generated on Sun Apr 20 03:37:48 2003 for Open Gaming System (OGS) by doxygen1.3