com.b3dgs.lionengine.game.strategy.ability
Class AbstractAttackerMeleeAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>

java.lang.Object
  extended by com.b3dgs.lionengine.game.strategy.ability.AbstractAttackerAbility<TTile,TSkill,TAttr>
      extended by com.b3dgs.lionengine.game.strategy.ability.AbstractAttackerMeleeAbility<TTile,TSkill,TAttr>
Type Parameters:
TTile - tile type used.
TSkill - skill type used.
TAttr - attributes type used.
All Implemented Interfaces:
AttackerAbility<TTile,TSkill,TAttr>
Direct Known Subclasses:
DefaultHeroAttackMelee

public abstract class AbstractAttackerMeleeAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
extends AbstractAttackerAbility<TTile,TSkill,TAttr>

Specific attacker ability implementation designed to be used for melee attack. When attack is ready, target can be hit, and a special function is called.


Field Summary
 
Fields inherited from class com.b3dgs.lionengine.game.strategy.ability.AbstractAttackerAbility
frame
 
Constructor Summary
AbstractAttackerMeleeAbility(AbstractUnit<TTile,TSkill,TAttr> attacker)
          Create a new attacker melee ability.
 
Method Summary
abstract  void onAttacked()
          Action called when entry finished its attack.
abstract  void onHitTarget(AbstractEntry<TTile,TSkill,TAttr> target)
          Action called when entry is attacking (hiting target).
 void onPause()
          Action called while entry is waiting for next attack.
 void onReaching()
          Action called while entry is reaching target.
 boolean onStartAttack()
          Action called when entry is going to attack.
 void stopAttack()
          Stop any action, reset all states.
 void updateAttack(float extrp)
          Update attack routine.
 
Methods inherited from class com.b3dgs.lionengine.game.strategy.ability.AbstractAttackerAbility
attack, isAttacking, onLostTarget, setAttackFrame, setAttackTimer, setMaximalAttackDistance, setMinimalAttackDistance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAttackerMeleeAbility

public AbstractAttackerMeleeAbility(AbstractUnit<TTile,TSkill,TAttr> attacker)
Create a new attacker melee ability.

Parameters:
attacker - owner reference.
Method Detail

updateAttack

public void updateAttack(float extrp)
Description copied from interface: AttackerAbility
Update attack routine.

Specified by:
updateAttack in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Overrides:
updateAttack in class AbstractAttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Parameters:
extrp - extrapolation value.

onHitTarget

public abstract void onHitTarget(AbstractEntry<TTile,TSkill,TAttr> target)
Action called when entry is attacking (hiting target).

Parameters:
target - target hit.

onAttacked

public abstract void onAttacked()
Action called when entry finished its attack.


stopAttack

public void stopAttack()
Description copied from interface: AttackerAbility
Stop any action, reset all states.

Specified by:
stopAttack in interface AttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Overrides:
stopAttack in class AbstractAttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>

onReaching

public void onReaching()
Description copied from class: AbstractAttackerAbility
Action called while entry is reaching target.

Specified by:
onReaching in class AbstractAttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>

onStartAttack

public boolean onStartAttack()
Description copied from class: AbstractAttackerAbility
Action called when entry is going to attack.

Specified by:
onStartAttack in class AbstractAttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>
Returns:
true if attack started.

onPause

public void onPause()
Description copied from class: AbstractAttackerAbility
Action called while entry is waiting for next attack.

Specified by:
onPause in class AbstractAttackerAbility<TTile extends AbstractPathTile,TSkill extends AbstractSkill<TTile,TSkill,TAttr>,TAttr extends AbstractAttributes>