OGS Java API Spec

ogs.core.details
Class Alignment

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.core.Feature
              |
              +--ogs.core.details.Alignment
All Implemented Interfaces:
Detail, EventListener

public class Alignment
extends Feature
implements Detail

A detail that represents attitudes on morals and order. Alignments are associated with entities (typically characters and creatures) that possess the concepts of good and evil, law and chaos. Items can also be imbued with emanations of an alignment.


Field Summary
static int CHAOS
          An absolute alignment favoring chaos and anarchy.
static int CHAOTIC_EVIL
          A relative alignment favoring chaos and evil.
static int CHAOTIC_GOOD
          A relative alignment favoring chaos and good.
static int CHAOTIC_NEUTRAL
          A relative alignment favoring true chaos.
static int EVIL
          An absolute alignment favoring bad and evil.
static int GOOD
          An absolute alignment favoring good and just.
static int LAW
          An absolute alignment favoring law and order.
static int LAWFUL_EVIL
          A relative alignment favoring law and evil.
static int LAWFUL_GOOD
          A relative alignment favoring law and good.
static int LAWFUL_NEUTRAL
          A relative alignment favoring true law.
static int NEUTRAL_EVIL
          A relative alignment favoring evil in general.
static int NEUTRAL_GOOD
          A relative alignment favoring good in general.
static int NEUTRAL_MORAL
          An absolute alignment favoring neither good nor evil.
static int NEUTRAL_ORDER
          An absolute alignment favoring neither law nor chaos.
static int TRUE_NEUTRAL
           
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
Alignment()
          Create a true neutral alignment.
Alignment(int value)
          Create a new alignment.
 
Method Summary
 int getValue()
          Determine the value of this alignment.
 boolean isAbsolute()
          Determine if this alignment is an absolute alignment.
 boolean isAligned(Alignment alignment)
          Determine if this alignment is aligned with another alignment.
 boolean isRelative()
          Determine if this alignment is a relative alignment.
 void setValue(int value)
          Change the value of this alignment.
 
Methods inherited from class ogs.core.Feature
attachObject, canAttach, canDetach, detachObject, getObject
 
Methods inherited from class ogs.support.Object
addListener, handleEvent, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LAW

public static final int LAW
An absolute alignment favoring law and order.

See Also:
Constant Field Values

CHAOS

public static final int CHAOS
An absolute alignment favoring chaos and anarchy.

See Also:
Constant Field Values

NEUTRAL_ORDER

public static final int NEUTRAL_ORDER
An absolute alignment favoring neither law nor chaos.

See Also:
Constant Field Values

GOOD

public static final int GOOD
An absolute alignment favoring good and just.

See Also:
Constant Field Values

EVIL

public static final int EVIL
An absolute alignment favoring bad and evil.

See Also:
Constant Field Values

NEUTRAL_MORAL

public static final int NEUTRAL_MORAL
An absolute alignment favoring neither good nor evil.

See Also:
Constant Field Values

LAWFUL_GOOD

public static final int LAWFUL_GOOD
A relative alignment favoring law and good.

See Also:
Constant Field Values

NEUTRAL_GOOD

public static final int NEUTRAL_GOOD
A relative alignment favoring good in general.

See Also:
Constant Field Values

CHAOTIC_GOOD

public static final int CHAOTIC_GOOD
A relative alignment favoring chaos and good.

See Also:
Constant Field Values

LAWFUL_NEUTRAL

public static final int LAWFUL_NEUTRAL
A relative alignment favoring true law.

See Also:
Constant Field Values

TRUE_NEUTRAL

public static final int TRUE_NEUTRAL
See Also:
Constant Field Values

CHAOTIC_NEUTRAL

public static final int CHAOTIC_NEUTRAL
A relative alignment favoring true chaos.

See Also:
Constant Field Values

LAWFUL_EVIL

public static final int LAWFUL_EVIL
A relative alignment favoring law and evil.

See Also:
Constant Field Values

NEUTRAL_EVIL

public static final int NEUTRAL_EVIL
A relative alignment favoring evil in general.

See Also:
Constant Field Values

CHAOTIC_EVIL

public static final int CHAOTIC_EVIL
A relative alignment favoring chaos and evil.

See Also:
Constant Field Values
Constructor Detail

Alignment

public Alignment()
Create a true neutral alignment.


Alignment

public Alignment(int value)
Create a new alignment. The alignment may be an absolute alignment or a relative alignment.

Parameters:
value - One of the predefined alignment values.
Throws:
IllegalArgumentException - If value is an invalid alignment.
Method Detail

isAbsolute

public boolean isAbsolute()
Determine if this alignment is an absolute alignment.

Returns:
True if this alignment is an absolute alignment.

isRelative

public boolean isRelative()
Determine if this alignment is a relative alignment.

Returns:
True if this alignment is a relative alignment.

isAligned

public boolean isAligned(Alignment alignment)
Determine if this alignment is aligned with another alignment. Two alignments are aligned if one is an absolute alignment and the other is a relative alignment and the relative alignment favors the absolute alignment.

Parameters:
alignment - An alignment.
Returns:
True if the two alignments are aligned.

getValue

public int getValue()
Determine the value of this alignment.

Returns:
One of the predefined alignment values.

setValue

public void setValue(int value)
Change the value of this alignment. If the value is invalid, this alignment remains unchanged.

Parameters:
value - One of the predefined alignment values.

OGS Java API Spec