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

ogs::core::Modifiers Class Reference

A list of modifiers. More...

#include <Modifiers.h>

Inheritance diagram for ogs::core::Modifiers:

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

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Modifiers ()
 Create an empty list of modifiers.

void addModifier (Modifier &modifier)
 Add a modifier to this list of modifiers.

void removeModifier (Modifier &modifier)
 Remove a modifier from this list of modifiers.

Modifier::Value getValue () const
 Determine the total value of all modifiers in this list.


Detailed Description

A modifier list allows objects to observe a single object rather than each modifier in the list. A modifier list intercepts events caused by each modifier in the list. It also generates its own events when a modifier is added or removed from the list. In either case, the list updates a total value, cached internally, and transmits an event to observers of the list. Note that a modifier list behaves just like an STL list. If dynamically allocated modifiers are added to it, they must be deallocated by the caller.


Member Function Documentation

void Modifiers::addModifier Modifier modifier  ) 
 

The total value is updated accordingly and observers are notified.

Parameters:
modifier A modifier to be added to the list.

Modifier::Value ogs::core::Modifiers::getValue  )  const [inline]
 

Returns:
Total value of all modifiers in this list.

Reimplemented in ogs::core::Defense.

void Modifiers::removeModifier Modifier modifier  ) 
 

The total value is updated accordingly and observers are notified.

Parameters:
modifier A modifier to be removed from the list.


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