|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.b3dgs.lionengine.game.purviews.Configurable
com.b3dgs.lionengine.game.Entity
com.b3dgs.lionengine.game.strategy.AbstractEntry<TTile,TSkill,TAttr>
com.b3dgs.lionengine.game.strategy.AbstractUnit<TTile,TSkill,TAttr>
com.b3dgs.lionengine.game.hacknslash.AbstractHero<TTile,TSkill,TAttr>
public abstract class AbstractHero<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Field Summary |
---|
Fields inherited from class com.b3dgs.lionengine.game.strategy.AbstractUnit |
---|
damages, pathfindable |
Fields inherited from class com.b3dgs.lionengine.game.strategy.AbstractEntry |
---|
anim, animName, attr, icon, id, lastAttacker, life, map, offsetX, offsetY, sprite |
Fields inherited from class com.b3dgs.lionengine.game.Entity |
---|
collisionable, height, mirrorable, width, x, xOld, y, yOld |
Constructor Summary | |
---|---|
AbstractHero(java.lang.String data,
PathBasedMap<TTile> map,
java.lang.String surface,
boolean alpha,
TAttr attr)
|
Method Summary | |
---|---|
void |
addAttack(int num,
AttackerAbility<TTile,TSkill,TAttr> attack)
|
void |
attack(AbstractEntry<TTile,TSkill,TAttr> entry)
Define a target to attack. |
boolean |
isAttacking()
Check if entry is attacking. |
void |
onSelection()
Action called when entry is selected (in case of a single selection). |
void |
setAttack(int num)
|
void |
setAttackFrame(int frame)
Represent the frame number (inside animation) which design the attack action. |
void |
setAttackTimer(int time)
Set attack pause time between two attacks. |
void |
setMaximalAttackDistance(int max)
Set maximum attack distance bewteen entry and target. |
void |
setMinimalAttackDistance(int min)
Set minimum attack distance bewteen entry and target. |
void |
stop()
Stop any action, reset all states. |
void |
stopAttack()
Stop any action, reset all states. |
void |
update(Keyboard keyboard,
Mouse mouse,
float extrp)
This function can be overrided, be you should call super.update first, as it already does standard updates (updateMirror & updateMoves). |
void |
updateAttack(float extrp)
Deprecated. |
Methods inherited from class com.b3dgs.lionengine.game.strategy.AbstractUnit |
---|
assignDestination, clearIgnoredID, follow, getAngle, getMoveX, getMoveY, getOrientation, getOrientationOld, getSpeedX, getSpeedY, getTarget, getX, getXInTile, getY, getYInTile, hasReachedDestination, ignoreID, isIgnoredID, isMoving, manualMove, onArrived, onDied, onMove, onStartMove, pathExists, place, pointTo, pointTo, setArrived, setHackNSlash, setOrientation, setSpeed, setTarget, stopMoves, updateMirror, updateMoves |
Methods inherited from class com.b3dgs.lionengine.game.strategy.AbstractEntry |
---|
addSkill, applyOrder, applyOrder, getAnimState, getDistance, getDistance, getFieldOfView, getFrame, getHeight, getHeightInTile, getLayer, getLayerOld, getOrderedSkill, getOwnerID, getRealFrame, getSkill, getSkills, getWidth, getWidthInTile, getXOffset, getYOffset, hasChangedLayer, isActive, isAlive, isOver, isRemoved, isSelected, isUnselected, isVisible, onHit, onKilled, onOrdered, onOrderedFail, play, play, play, remove, removeRef, removeSkill, render, setActive, setAlive, setAnimation, setFieldOfView, setFrame, setLayer, setLayerChanged, setOrderedSkill, setOver, setOwnerID, setSelection, setSkipLastFrameOnReverse, setVisibility, stopAnimation, unselect, updateAnimation |
Methods inherited from class com.b3dgs.lionengine.game.Entity |
---|
backupCoord, cancelMirror, collide, collide, getCancelMirror, getCollision, getMirror, getRay, getXOld, getXReal, getYOld, getYReal, invertYAxis, mirror, move, renderCollision, updateCollision |
Methods inherited from class com.b3dgs.lionengine.game.purviews.Configurable |
---|
checkInstruction, getAnim, getCollArea, getData, getDataBool, getDataInt, getDataString, getRange, loadData |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractHero(java.lang.String data, PathBasedMap<TTile> map, java.lang.String surface, boolean alpha, TAttr attr)
Method Detail |
---|
public void addAttack(int num, AttackerAbility<TTile,TSkill,TAttr> attack)
public void update(Keyboard keyboard, Mouse mouse, float extrp)
AbstractUnit
update
in class AbstractUnit<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
keyboard
- keyboard reference.mouse
- mouse reference.extrp
- extrapolation value.public void stop()
AbstractUnit
stop
in class AbstractUnit<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void onSelection()
AbstractEntry
onSelection
in class AbstractEntry<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void setAttack(int num)
@Deprecated public void updateAttack(float extrp)
AttackerAbility
updateAttack
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
extrp
- extrapolation value.public void attack(AbstractEntry<TTile,TSkill,TAttr> entry)
AttackerAbility
attack
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
entry
- target.public void stopAttack()
AttackerAbility
stopAttack
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
public void setAttackTimer(int time)
AttackerAbility
setAttackTimer
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
time
- attack pause time.public void setAttackFrame(int frame)
AttackerAbility
setAttackFrame
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
frame
- frame attack number.public void setMinimalAttackDistance(int min)
AttackerAbility
setMinimalAttackDistance
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
min
- minimum attack distance.public void setMaximalAttackDistance(int max)
AttackerAbility
setMaximalAttackDistance
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
max
- maximum attack distance.public boolean isAttacking()
AttackerAbility
isAttacking
in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |