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

ogs::support::Attachable Class Reference

An object that can be attached to another object. More...

#include <Attachable.h>

Inheritance diagram for ogs::support::Attachable:

Inheritance graph
[legend]
List of all members.

Public Member Functions

virtual bool attachObject (Object &object)=0
 Attach this attachable to an object.

virtual bool detachObject ()=0
 Detach this attachable from an object.

virtual ObjectgetObject () const=0
 Determine the object that this attachable is currently attached to.


Detailed Description

An attachable object follows the Decorator design pattern. While attached, an attachable object may (or may not) modify its subject (the object that it is attached to). These modifications may (or may not) be reversible when (and if) the attachable is detached from the subject. Attachable objects that do not modify the subject simply add additional detail to the object.


Member Function Documentation

virtual bool ogs::support::Attachable::attachObject Object object  )  [pure virtual]
 

This function first determines whether this object can be attached to the specified object. This step usually checks whether the object is being attached to itself or whether it is already attached. If the object can be attached, this function then applies any modifications to the attached object and returns true. Otherwise, this function should simply return false.

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

Implemented in ogs::core::CClass, ogs::core::Feature, ogs::core::Item, ogs::cclasses::Paladin, ogs::feats::Alertness, ogs::feats::ImprovedInitiative, ogs::feats::ImprovedSave, and ogs::feats::Toughness.

virtual bool ogs::support::Attachable::detachObject  )  [pure virtual]
 

This function determines if this object is attached and, if so, whether it can be detached from the attached object. If it can, the function removes or otherwise reverses any modifications made to the attached object and returns true. Otherwise, the function returns false.

Returns:
True if this attachable is detached from the object.

Implemented in ogs::core::CClass, ogs::core::Feature, ogs::core::Item, ogs::cclasses::Paladin, ogs::feats::Alertness, ogs::feats::ImprovedInitiative, and ogs::feats::ImprovedSave.

virtual Object* ogs::support::Attachable::getObject  )  const [pure virtual]
 

If the attachable is not currently attached to any object, this function returns null.

Returns:
Attached object or null if not attached.

Implemented in ogs::core::CClass, ogs::core::Feature, and ogs::core::Item.


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