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

ogs::core::CClass Class Reference

A career of a character. More...

#include <CClass.h>

Inheritance diagram for ogs::core::CClass:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual bool attachObject (ogs::support::Object &object)
 Attach this cclass to an object.

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

ogs::support::ObjectgetObject () const
 Determine the character that this cclass is attached to.

Die::Sides getHitDie () const
 Determine the hit die for this type of cclass.

Skill::Points getSkillRate () const
 Determine the skill rate of this cclass.

XP::Level getLevel () const
 Determine the experience level of this cclass.

void setLevel (XP::Level xpLevel)
 Change the experience level of this cclass.


Protected Member Functions

 CClass (Die::Sides hitDie, Skill::Points skillRate, XP::Level xpLevel, Modifier::Value baseAttack, Modifier::Value baseFort, Modifier::Value baseRef, Modifier::Value baseWill)
 Create a new character class.

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

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

virtual void updateCClass ()
 Update this cclass.


Detailed Description

A character class represents a specific career or role that a character assumes during their life of adventure. Many characters focus on only one such character class but a character can have more than one character class. Character classes are designed to allow creatures increase their overall potential and extend their inherent racial capabilities.

Character class is abbreviated as cclass to differentiate the term "class" from the object-oriented concept of a class. CClasses that are derived from the CClass class represent specific player character classes, nonplayer character classes, and prestige classes. Prestige classes are cclasses that have prerequisites.


Constructor & Destructor Documentation

CClass::CClass Die::Sides  hitDie,
Skill::Points  skillRate,
XP::Level  xpLevel,
Modifier::Value  baseAttack,
Modifier::Value  baseFort,
Modifier::Value  baseRef,
Modifier::Value  baseWill
[protected]
 

The experience level of the class is taken from the number of hit dice. This value is used to initialize the base attack and save bonuses. The average advancement rate is used by default for the attack bonus and the weak advancement rates are used by default for the save bonuses.

Parameters:
hitDie Hit die of this type of class.
skillRate Skill rate of this type of class.
xpLevel Experience level of this cclass.
baseAttack Value of base attack bonus.
baseFort Value of base Fortitude save bonus.
baseRef Value of base Reflex save bonus.
baseWill Value of base Will save bonus.


Member Function Documentation

bool CClass::attachObject ogs::support::Object object  )  [virtual]
 

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

Parameters:
object An object to attach this cclass to.
Returns:
True if this cclass is attached to object.

Implements ogs::support::Attachable.

Reimplemented in ogs::cclasses::Paladin.

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

A cclass can not be attached to itself or if it is already attached. A cclass can only be attached to characters.

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

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

A cclass can not be detached from a character by default once it is attached.

Returns:
True if this cclass is detached from character.

bool CClass::detachObject  )  [virtual]
 

This function resets the character pointer to null. Derived classes that override this function should therefore call the getObject() function before calling this function.

Returns:
True if this cclass is detached from character.

Implements ogs::support::Attachable.

Reimplemented in ogs::cclasses::Paladin.

Die::Sides ogs::core::CClass::getHitDie  )  const [inline]
 

Returns:
Hit die of this type of cclass.

XP::Level ogs::core::CClass::getLevel  )  const [inline]
 

Returns:
Experience level of this cclass.

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

If this cclass is not attached, this function returns NULL.

Returns:
Pointer to character object or NULL if not attached.

Implements ogs::support::Attachable.

Skill::Points ogs::core::CClass::getSkillRate  )  const [inline]
 

The skill rate is the number of skill points that a character gains for each experience level in this cclass.

Returns:
Skill rate of this cclass.

void CClass::setLevel XP::Level  xpLevel  ) 
 

When the experience level is changed, all bonuses for this cclass are updated and observers are notified of the change.

Parameters:
xpLevel An experience level.

Reimplemented in ogs::cclasses::Monk.

void CClass::updateCClass  )  [protected, virtual]
 

This function is called when the experience level of this cclass changes. By default, it only updates the modifiers associated with this cclass using the average attack and weak save bonuses. Derived classes should override this function to use different bonuses and to add or remove specific cclass features.


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