com.realtime.crossfire.jxclient.spells
Class Spell

java.lang.Object
  extended by com.realtime.crossfire.jxclient.spells.Spell

public class Spell
extends java.lang.Object

Describes a Crossfire spell.


Field Summary
private  int castingTime
           
private  int damage
           
private  int faceNum
           
private  int grace
           
private  int level
           
private  java.util.Collection<SpellListener> listeners
           
private  int mana
           
private  java.lang.String message
           
private  java.lang.String name
           
private  int path
           
private  int skill
           
private  int tag
           
private  boolean unknown
           
 
Constructor Summary
Spell(java.lang.String name)
           
 
Method Summary
 void addSpellListener(SpellListener listener)
          Adds a SpellListener to be notified of changes.
private  void fireChanged()
          Notifies all listeners.
 int getCastingTime()
           
 int getDamage()
           
 int getFaceNum()
           
 int getGrace()
           
 int getLevel()
           
 int getMana()
           
 java.lang.String getMessage()
           
 java.lang.String getName()
           
 int getPath()
           
 int getSkill()
           
 int getTag()
           
 java.lang.String getTooltipText()
          Return a description for this spell to be used in tooltips.
 boolean isUnknown()
          Returns whether this spell is unknown to the character.
 void removeSpellListener(SpellListener listener)
          Removes a SpellListener to be notified of changes.
 void setParameters(int faceNum, int tag, java.lang.String message, int level, int castingTime, int mana, int grace, int damage, int skill, int path)
           
 void setParameters(Spell spell)
          Updates the spell's parameters from another Spell instance.
 void setUnknown(boolean unknown)
          Marks this spell as known or unknown for the character.
 java.lang.String toString()
           
 void updateParameters(boolean updateMana, int mana, boolean updateGrace, int grace, boolean updateDamage, int damage)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

castingTime

private int castingTime

damage

private int damage

faceNum

private int faceNum

grace

private int grace

level

private int level

listeners

@NotNull
private final java.util.Collection<SpellListener> listeners

mana

private int mana

message

@NotNull
private java.lang.String message

name

@NotNull
private final java.lang.String name

path

private int path

skill

private int skill

tag

private int tag

unknown

private boolean unknown
Constructor Detail

Spell

public Spell(@NotNull
             java.lang.String name)
Method Detail

addSpellListener

public void addSpellListener(@NotNull
                             SpellListener listener)
Adds a SpellListener to be notified of changes.

Parameters:
listener - the listener to add

fireChanged

private void fireChanged()
Notifies all listeners.


getCastingTime

public int getCastingTime()

getDamage

public int getDamage()

getFaceNum

public int getFaceNum()

getGrace

public int getGrace()

getLevel

public int getLevel()

getMana

public int getMana()

getMessage

@NotNull
public java.lang.String getMessage()

getName

@NotNull
public java.lang.String getName()

getPath

public int getPath()

getSkill

public int getSkill()

getTag

public int getTag()

getTooltipText

@NotNull
public java.lang.String getTooltipText()
Return a description for this spell to be used in tooltips.

Returns:
The tooltip text.

isUnknown

public boolean isUnknown()
Returns whether this spell is unknown to the character.

Returns:
whether this spell is unknown

removeSpellListener

public void removeSpellListener(@NotNull
                                SpellListener listener)
Removes a SpellListener to be notified of changes.

Parameters:
listener - the listener to remove

setParameters

public void setParameters(int faceNum,
                          int tag,
                          @NotNull
                          java.lang.String message,
                          int level,
                          int castingTime,
                          int mana,
                          int grace,
                          int damage,
                          int skill,
                          int path)

setParameters

public void setParameters(@NotNull
                          Spell spell)
Updates the spell's parameters from another Spell instance. The name and unknown flag values are not copied.

Parameters:
spell - the spell instance to copy from

setUnknown

public void setUnknown(boolean unknown)
Marks this spell as known or unknown for the character.

Parameters:
unknown - whether this spell is unknown

toString

@NotNull
public java.lang.String toString()
Overrides:
toString in class java.lang.Object

updateParameters

public void updateParameters(boolean updateMana,
                             int mana,
                             boolean updateGrace,
                             int grace,
                             boolean updateDamage,
                             int damage)