spellcast.damage
Class DamageType

java.lang.Object
  extended by spellcast.damage.DamageType
All Implemented Interfaces:
util.Nullable
Direct Known Subclasses:
NullDamageType

public class DamageType
extends java.lang.Object
implements util.Nullable

The type for damage being dealt. DamageType uses a Flyweight pattern and instances are created through the getX() calls.

Author:
Barrie Treloar

Field Summary
static DamageType[] ALL_DAMAGE_TYPES
          List of all the DamageTypes.
 
Constructor Summary
protected DamageType(java.lang.String type_)
          DamageType is not instantied but accessed from the Flyweight factory methods getX(), where X is one of the available damage types.
 
Method Summary
 boolean equals(java.lang.Object o)
          A damage type is equal to another damage type if they have the same type.
static DamageType getColdDamageType()
           
static DamageType getFireDamageType()
           
static DamageType getPhysicalDamageType()
           
 java.lang.String getType()
           
 boolean isNull()
          
 void setNull(boolean isNullable)
          Set whether this object is a Nullable.
 void setType(java.lang.String type_)
           
 java.lang.String toString()
          The string value of a damage type is it's type.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ALL_DAMAGE_TYPES

public static final DamageType[] ALL_DAMAGE_TYPES
List of all the DamageTypes.

Constructor Detail

DamageType

protected DamageType(java.lang.String type_)
DamageType is not instantied but accessed from the Flyweight factory methods getX(), where X is one of the available damage types.

Method Detail

setNull

public final void setNull(boolean isNullable)
Set whether this object is a Nullable.

Parameters:
isNullable - true if this object is a Null instance, false otherwise.

isNull

public final boolean isNull()

Specified by:
isNull in interface util.Nullable

equals

public boolean equals(java.lang.Object o)
A damage type is equal to another damage type if they have the same type.

Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
The string value of a damage type is it's type.

Overrides:
toString in class java.lang.Object

getType

public java.lang.String getType()

setType

public void setType(java.lang.String type_)

getPhysicalDamageType

public static final DamageType getPhysicalDamageType()

getFireDamageType

public static final DamageType getFireDamageType()

getColdDamageType

public static final DamageType getColdDamageType()


Copyright © 2001-2005 Spellcast. All Rights Reserved.