Crossfire JXClient, Trunk  R20561
com.realtime.crossfire.jxclient.skills.Skill Class Reference

One skill of the character. More...

+ Collaboration diagram for com.realtime.crossfire.jxclient.skills.Skill:

Public Member Functions

void addSkillListener (@NotNull final SkillListener listener)
 Adds a listener to be notified of changes. More...
 
long getExperience ()
 Returns the skill experience. More...
 
int getFace ()
 Returns the skill's face. More...
 
int getLevel ()
 Returns the skill level. More...
 
void removeSkillListener (@NotNull final SkillListener listener)
 Removes a listener to be notified of changes. More...
 
void set (final int level, final long experience)
 Updates the skill attributes. More...
 
void setFace (final int face)
 Defines the skill's face. More...
 
 Skill (@NotNull final String name)
 Creates a new instance. More...
 
String toString ()
 

Private Member Functions

void fireAddSkill ()
 Notifies all listeners about a gained skill. More...
 
void fireDelSkill ()
 Notifies all listeners about a lost attribute. More...
 
void fireEvents (final boolean oldKnown)
 Notifies all listeners about changes. More...
 
void fireUpdSkill ()
 Notifies all listeners about an updated attribute. More...
 
boolean isKnown ()
 Returns whether the skill is known. More...
 

Private Attributes

long experience
 The skill experience. More...
 
int face = -1
 The skill's face number. More...
 
int level
 The skill level. More...
 
final EventListenerList2< SkillListenerlisteners = new EventListenerList2<>()
 The listeners to inform of changes. More...
 
final String name
 The skill name. More...
 

Detailed Description

One skill of the character.

Author
Lauwenmark
Andreas Kirschbaum

Definition at line 32 of file Skill.java.

Constructor & Destructor Documentation

◆ Skill()

com.realtime.crossfire.jxclient.skills.Skill.Skill ( @NotNull final String  name)

Creates a new instance.

Parameters
namethe skill name

Definition at line 65 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.name.

Member Function Documentation

◆ addSkillListener()

void com.realtime.crossfire.jxclient.skills.Skill.addSkillListener ( @NotNull final SkillListener  listener)

Adds a listener to be notified of changes.

Parameters
listenerthe listener to add

Definition at line 182 of file Skill.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.add().

Referenced by com.realtime.crossfire.jxclient.skin.events.SkillAddedSkinEvent.SkillAddedSkinEvent(), com.realtime.crossfire.jxclient.gui.gauge.SkillGaugeUpdater.SkillGaugeUpdater(), and com.realtime.crossfire.jxclient.skin.events.SkillRemovedSkinEvent.SkillRemovedSkinEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fireAddSkill()

void com.realtime.crossfire.jxclient.skills.Skill.fireAddSkill ( )
private

Notifies all listeners about a gained skill.

Definition at line 154 of file Skill.java.

Referenced by com.realtime.crossfire.jxclient.skills.Skill.fireEvents().

+ Here is the caller graph for this function:

◆ fireDelSkill()

void com.realtime.crossfire.jxclient.skills.Skill.fireDelSkill ( )
private

Notifies all listeners about a lost attribute.

Definition at line 163 of file Skill.java.

Referenced by com.realtime.crossfire.jxclient.skills.Skill.fireEvents().

+ Here is the caller graph for this function:

◆ fireEvents()

void com.realtime.crossfire.jxclient.skills.Skill.fireEvents ( final boolean  oldKnown)
private

Notifies all listeners about changes.

Parameters
oldKnownwhether the skill was known before the update

Definition at line 138 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.fireAddSkill(), com.realtime.crossfire.jxclient.skills.Skill.fireDelSkill(), com.realtime.crossfire.jxclient.skills.Skill.fireUpdSkill(), and com.realtime.crossfire.jxclient.skills.Skill.isKnown().

Referenced by com.realtime.crossfire.jxclient.skills.Skill.set().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fireUpdSkill()

void com.realtime.crossfire.jxclient.skills.Skill.fireUpdSkill ( )
private

Notifies all listeners about an updated attribute.

Definition at line 172 of file Skill.java.

Referenced by com.realtime.crossfire.jxclient.skills.Skill.fireEvents().

+ Here is the caller graph for this function:

◆ getExperience()

long com.realtime.crossfire.jxclient.skills.Skill.getExperience ( )

Returns the skill experience.

Returns
the skill experience

Definition at line 89 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.experience.

Referenced by com.realtime.crossfire.jxclient.scripts.DefaultScriptProcess.cmdRequest().

+ Here is the caller graph for this function:

◆ getFace()

int com.realtime.crossfire.jxclient.skills.Skill.getFace ( )

Returns the skill's face.

Returns
face number, -1 if no face defined.

Definition at line 105 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.face.

Referenced by com.realtime.crossfire.jxclient.items.SpellSkillView.getItem().

+ Here is the caller graph for this function:

◆ getLevel()

int com.realtime.crossfire.jxclient.skills.Skill.getLevel ( )

◆ isKnown()

boolean com.realtime.crossfire.jxclient.skills.Skill.isKnown ( )
private

Returns whether the skill is known.

Returns
whether the skill is known

Definition at line 121 of file Skill.java.

Referenced by com.realtime.crossfire.jxclient.skills.Skill.fireEvents(), and com.realtime.crossfire.jxclient.skills.Skill.set().

+ Here is the caller graph for this function:

◆ removeSkillListener()

void com.realtime.crossfire.jxclient.skills.Skill.removeSkillListener ( @NotNull final SkillListener  listener)

Removes a listener to be notified of changes.

Parameters
listenerthe listener to remove

Definition at line 190 of file Skill.java.

References com.realtime.crossfire.jxclient.util.EventListenerList2< T extends EventListener >.remove().

Referenced by com.realtime.crossfire.jxclient.gui.gauge.SkillGaugeUpdater.dispose(), com.realtime.crossfire.jxclient.skin.events.SkillRemovedSkinEvent.dispose(), and com.realtime.crossfire.jxclient.skin.events.SkillAddedSkinEvent.dispose().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ set()

void com.realtime.crossfire.jxclient.skills.Skill.set ( final int  level,
final long  experience 
)

Updates the skill attributes.

Parameters
levelthe new skill level
experiencethe new skill experience

Definition at line 74 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.experience, com.realtime.crossfire.jxclient.skills.Skill.fireEvents(), com.realtime.crossfire.jxclient.skills.Skill.isKnown(), and com.realtime.crossfire.jxclient.skills.Skill.level.

Referenced by com.realtime.crossfire.jxclient.skills.SkillSet.addSkill(), and com.realtime.crossfire.jxclient.stats.Stats.setStatSkill().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setFace()

void com.realtime.crossfire.jxclient.skills.Skill.setFace ( final int  face)

Defines the skill's face.

Parameters
facenew face index.

Definition at line 113 of file Skill.java.

References com.realtime.crossfire.jxclient.skills.Skill.face.

Referenced by com.realtime.crossfire.jxclient.skills.SkillSet.getNamedSkill().

+ Here is the caller graph for this function:

◆ toString()

Member Data Documentation

◆ experience

long com.realtime.crossfire.jxclient.skills.Skill.experience
private

◆ face

int com.realtime.crossfire.jxclient.skills.Skill.face = -1
private

◆ level

int com.realtime.crossfire.jxclient.skills.Skill.level
private

◆ listeners

final EventListenerList2<SkillListener> com.realtime.crossfire.jxclient.skills.Skill.listeners = new EventListenerList2<>()
private

The listeners to inform of changes.

Definition at line 38 of file Skill.java.

◆ name

final String com.realtime.crossfire.jxclient.skills.Skill.name
private

The documentation for this class was generated from the following file: