|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.strategy.AbstractSkill<TTile,TSkill,TAttr>
TTile
- tile type used.TSkill
- skill type used.TAttr
- attributes type used.public abstract class AbstractSkill<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Abstract structure of a skill, used by any kind of entry. It already contains name, displayble name, description, level, and icon. This model has to be implemented in order to specify the action. To be created, it needs the filename containing skills data, and the skill name.
SkillData
Field Summary | |
---|---|
protected int |
destX
Skill action destination (if target is null). |
protected int |
destY
Skill action destination (if target is null). |
AbstractEntry<TTile,TSkill,TAttr> |
owner
Skill owner. |
protected AbstractEntry<TTile,TSkill,TAttr> |
target
Skill action destination (if destX/Y are negative). |
Constructor Summary | |
---|---|
AbstractSkill(java.lang.String file,
java.lang.String name,
int priority,
AbstractEntry<TTile,TSkill,TAttr> owner)
Create a new skill. |
Method Summary | |
---|---|
abstract void |
action()
Action executed on cast. |
java.lang.String |
getDesc()
Get skill description. |
java.lang.String |
getDisplayName()
Get the displayed skill name. |
int |
getIcon()
Get skill icon. |
int |
getLvl()
Get skill level. |
java.lang.String |
getName()
Get skill name. |
int |
getPriority()
Set priority level. |
boolean |
isActive()
Get active state. |
boolean |
isIgnored()
Get ignorance state. |
boolean |
isOrder()
Check if skill is an order or a simple button. |
boolean |
isSelected()
Get skill selection state. |
boolean |
isUnlocked()
Check if skill is unlocked. |
abstract void |
onClick()
Action called when clicked on skill from panel. |
abstract void |
renderOnMap(java.awt.Graphics2D g,
AbstractControlPanel<TTile,TSkill,TAttr> panel,
StrategyCursor cursor)
Rendering routine on map. |
abstract void |
renderOnPanel(java.awt.Graphics2D g,
AbstractControlPanel<TTile,TSkill,TAttr> panel,
StrategyCursor cursor,
TiledSprite icons,
int x,
int y,
int w,
int h)
Rendering routine on panel. |
void |
setActive(boolean state)
Set active state (true when using). |
void |
setDestination(int destX,
int destY)
Set the skill action destination (in real value; it will be automatically converted to map tile). |
void |
setIcon(int icon)
Set icon number. |
void |
setIgnore(boolean state)
Set ignorance state (it can be used to hide a certain part of skills). |
void |
setLvl(int lvl)
Set skill level. |
void |
setOrder(boolean state)
Set order state (an order will require a left click on map to assign it). |
void |
setRetry(boolean state)
Set entry owner keeping selection mode. |
void |
setSelected(boolean state)
Set skill selection state. |
void |
setTarget(AbstractEntry<TTile,TSkill,TAttr> target)
Set the skill action target. |
void |
setUnlocked(boolean state)
Set unlock state. |
abstract void |
updateOnMap(float extrp)
Update routine on map. |
abstract void |
updateOnPanel(AbstractControlPanel<TTile,TSkill,TAttr> panel)
Update routine on panel. |
boolean |
willRetry()
Check if skill will retry click. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final AbstractEntry<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes> owner
protected int destX
protected int destY
protected AbstractEntry<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes> target
Constructor Detail |
---|
public AbstractSkill(java.lang.String file, java.lang.String name, int priority, AbstractEntry<TTile,TSkill,TAttr> owner)
file
- skill data file name.name
- skill name.priority
- skill priority.owner
- entry owner reference.Method Detail |
---|
public abstract void updateOnMap(float extrp)
extrp
- extrapolation value.public abstract void updateOnPanel(AbstractControlPanel<TTile,TSkill,TAttr> panel)
panel
- panel reference.public abstract void renderOnMap(java.awt.Graphics2D g, AbstractControlPanel<TTile,TSkill,TAttr> panel, StrategyCursor cursor)
g
- graphic output.panel
- panel reference.cursor
- cursor reference.public abstract void renderOnPanel(java.awt.Graphics2D g, AbstractControlPanel<TTile,TSkill,TAttr> panel, StrategyCursor cursor, TiledSprite icons, int x, int y, int w, int h)
g
- graphic output.panel
- panel reference.cursor
- cursor reference.icons
- set if icons.x
- skill location x on panel.y
- skill location y on panel.w
- skill width on panel.h
- skill height on panel.public abstract void action()
public void setDestination(int destX, int destY)
destX
- real destination x (from cursor).destY
- real destination y (from cursor).public void setTarget(AbstractEntry<TTile,TSkill,TAttr> target)
target
- skill target.public java.lang.String getName()
public java.lang.String getDisplayName()
public java.lang.String getDesc()
public int getLvl()
public void setLvl(int lvl)
lvl
- level to set.public void setIcon(int icon)
icon
- icon number.public int getIcon()
public int getPriority()
public void setOrder(boolean state)
state
- order state.public boolean isOrder()
public void setIgnore(boolean state)
state
- ignorance state.public boolean isIgnored()
public void setActive(boolean state)
state
- active state.public boolean isActive()
public void setSelected(boolean state)
state
- selection state.public boolean isSelected()
public void setUnlocked(boolean state)
state
- unlocked state.public boolean isUnlocked()
public void setRetry(boolean state)
state
- retry state.public boolean willRetry()
public abstract void onClick()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |