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

ogs::core::Feature Class Reference

A feature is an object that can be attached to another object. More...

#include <Feature.h>

Inheritance diagram for ogs::core::Feature:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual bool attachObject (Object &object)
 Attach this feature to an object.

virtual bool detachObject ()
 Detach this feature from an object.

Object * getObject () const
 Determine the object that this feature is currently attached to.


Protected Member Functions

 Feature ()
 Create a new feature.

virtual bool canAttach (const Object &object) const
 Determine if this feature can be attached to an object.

virtual bool canDetach () const
 Determine if this feature can be detached from an object.


Detailed Description

While attached, a feature may modify the object that it is attached to. These modifications must be reversible if and when the feature is detached from the object.


Member Function Documentation

bool Feature::attachObject Object &  object  )  [virtual]
 

This method should always be called first by derived classes that override this method.

Parameters:
object Object to attach this feature to.
Returns:
True if the feature is attached to the object.

Implements ogs::support::Attachable.

Reimplemented in ogs::feats::Alertness, ogs::feats::ImprovedInitiative, ogs::feats::ImprovedSave, and ogs::feats::Toughness.

bool ogs::core::Feature::canAttach const Object &  object  )  const [inline, protected, virtual]
 

A feature can not be attached to itself or if it is already attached.

Parameters:
object Object to attach this feature to.
Returns:
True if the feature is attached to the object.

Reimplemented in ogs::core::Feat.

bool ogs::core::Feature::canDetach  )  const [inline, protected, virtual]
 

Returns:
True if the feature is detached from the object.

bool Feature::detachObject  )  [virtual]
 

This method should always be called last by derived classes that override this method.

Returns:
True if the feature is detached from the object.

Implements ogs::support::Attachable.

Reimplemented in ogs::feats::Alertness, ogs::feats::ImprovedInitiative, and ogs::feats::ImprovedSave.

ogs::support::Object * ogs::core::Feature::getObject  )  const [inline, virtual]
 

Returns:
Attached object or NULL if not attached.

Implements ogs::support::Attachable.


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