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

ogs::core::details::Alignment Class Reference

An indicator of morals and order. More...

#include <Alignment.h>

Inheritance diagram for ogs::core::details::Alignment:

Inheritance graph
[legend]
Collaboration diagram for ogs::core::details::Alignment:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Value {
  LAW = 1 << 3, CHAOS = 1 << 2, NEUTRAL_ORDER = (LAW | CHAOS), GOOD = 1 << 1,
  EVIL = 1 << 0, NEUTRAL_MORAL = (GOOD | EVIL), LAWFUL_GOOD = LAW | GOOD, NEUTRAL_GOOD = NEUTRAL_ORDER | GOOD,
  CHAOTIC_GOOD = CHAOS | GOOD, LAWFUL_NEUTRAL = LAW | NEUTRAL_MORAL, TRUE_NEUTRAL = NEUTRAL_ORDER | NEUTRAL_MORAL, CHAOTIC_NEUTRAL = CHAOS | NEUTRAL_MORAL,
  LAWFUL_EVIL = LAW | EVIL, NEUTRAL_EVIL = NEUTRAL_ORDER | EVIL, CHAOTIC_EVIL = CHAOS | EVIL
}
 An enumerated type representing the value of this alignment. More...


Public Member Functions

 Alignment (Value value=TRUE_NEUTRAL)
 Create a new alignment with a specified value.

bool isAbsolute () const
 Determine if this alignment is an absolute alignment.

bool isRelative () const
 Determine if this alignment is a relative alignment.

bool isAligned (const Alignment &a) const
 Determine if this alignment is aligned with another alignment.

Value getValue () const
 Determine the value of this alignment.

void setValue (Value value)
 Change the value of this alignment.


Detailed Description

Alignment has two primary dimensions: moral and order. In the moral dimension, an alignment can have different values: good, evil, or neutral, In the order dimension, an alignment can also have three different values: law, chaos, or neutral. These six discrete values are known as an absolute alignments. When the two dimensions are combined, an alignment can consist of nine different values known as relative alignments. <P

Alignments are typically associated with entities (characters and creatures) that delineate the concepts of good and evil, law and chaos, and neutrality. Items, and sometimes areas, can also be imbued with emanations of an alignment.


Member Enumeration Documentation

enum ogs::core::details::Alignment::Value
 

The values represent both absolute and relative alignments. The absolute alignments however are defined as bit masks that can be used in bitwise operators for the absolute alignments.

See also:
isAligned
Todo:
Document each relative alignment (some day when bored).


Constructor & Destructor Documentation

ogs::core::details::Alignment::Alignment Value  value = TRUE_NEUTRAL  )  [inline]
 

The default value is the relative alignment TRUE_NEUTRAL.

Parameters:
value Value of this alignment.


Member Function Documentation

Alignment::Value ogs::core::details::Alignment::getValue  )  const [inline]
 

Returns:
Value of alignment.

bool ogs::core::details::Alignment::isAbsolute  )  const [inline]
 

Returns:
True if this alignment is an absolute alignment.

bool ogs::core::details::Alignment::isAligned const Alignment &  a  )  const [inline]
 

Two alignments are aligned if one is an absolute alignment and the other is a relative alignment and the relative alignment is composed of the absolute alignment.

Parameters:
a An alignment.

bool ogs::core::details::Alignment::isRelative  )  const [inline]
 

Returns:
True if this alignment is a relative alignment.

void ogs::core::details::Alignment::setValue Value  value  )  [inline]
 

Parameters:
value Value of alignment.


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