OGS Java API Spec

ogs.core
Class Defense

java.lang.Object
  |
  +--ogs.support.Object
        |
        +--ogs.core.Defense
All Implemented Interfaces:
EventListener

public class Defense
extends Object

A defense (also known as armor class) is a rating of the defensive capabilities of an entity.


Field Summary
static int BASE_RATING
          The base value of an unmodified defense rating.
 
Fields inherited from class ogs.support.Object
listeners
 
Constructor Summary
Defense()
           
 
Method Summary
 void addModifier(Modifier modifier)
          Add a modifier to the defense rating.
 int getValue()
          Determine the current defense rating.
 void handleEvent(EventObject event)
          Update the defense rating by adding all modifiers to the base defense rating.
 void removeModifier(Modifier modifier)
          Remove a modifier from the defense rating.
 
Methods inherited from class ogs.support.Object
addListener, notifyListeners, removeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_RATING

public static final int BASE_RATING
The base value of an unmodified defense rating.

See Also:
Constant Field Values
Constructor Detail

Defense

public Defense()
Method Detail

addModifier

public void addModifier(Modifier modifier)
Add a modifier to the defense rating.

Parameters:
modifier - A defense modifier.

removeModifier

public void removeModifier(Modifier modifier)
Remove a modifier from the defense rating.

Parameters:
modifier - A defense modifier.

getValue

public int getValue()
Determine the current defense rating.

Returns:
current defense rating

handleEvent

public void handleEvent(EventObject event)
Update the defense rating by adding all modifiers to the base defense rating.

Overrides:
handleEvent in class Object
Parameters:
event - Event that occured (not used).

OGS Java API Spec