Bandidos
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
com.mygdx.game.components.attacking.BaseEnemyAttackComponent Class Referenceabstract
Inheritance diagram for com.mygdx.game.components.attacking.BaseEnemyAttackComponent:
com.mygdx.game.engine.entities.components.BaseEntityComponent com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.components.attacking.HeavyBanditAttackComponent com.mygdx.game.components.attacking.LightBanditAttackComponent com.mygdx.game.components.attacking.MediumBanditAttackComponent

Public Member Functions

 BaseEnemyAttackComponent (float dmg, int rangeInTiles)
 
abstract boolean isAttacking ()
 
void attack (HealthComponent hc)
 
void stopAttacking ()
 
int getRangeInTiles ()
 
float getDamage ()
 
void setAnimationComponent (AnimationComponent animationComponent)
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
EngineTween startTweenOnComponent (Tween tween, TweenStartType tweenStartType)
 
Timeline startTimelineOnComponent (Timeline timeline, boolean updateInGameTime)
 
EngineTween doFloat (TweenableFloat floatToTween, float newValue, float duration, TweenStartType tweenStartType)
 
void stopAllComponentTweens ()
 
void initialize (BaseEntity parentEntity)
 
BaseEntity getParentOfComponent ()
 
boolean isActive ()
 
boolean isDestroyed ()
 
void setActiveState (boolean activeState)
 
void destroy ()
 
void update (float deltaTime)
 
abstract void awake ()
 
- Public Member Functions inherited from com.mygdx.game.engine.events.EventDispatcher
void addEventListener (String type, IEventReceiver listeningClass)
 
void dispatchEvent (Event event)
 
void removeEventListener (String type, IEventReceiver listener)
 
boolean hasEventListener (String type)
 
ArrayList< ListenerItemgetAllListeners ()
 
void destroyAllListeners ()
 
void clean ()
 

Static Public Attributes

static final String STARTED_ATTACKING_EVENT = "StartedAttackingEvent"
 
static final String STOPPED_ATTACKING_EVENT = "StoppedAttackingEvent"
 

Protected Member Functions

AnimationComponent getAnimationComponent ()
 
void destroyed ()
 
abstract void attackCall (HealthComponent hc)
 
abstract void stopAttackingCall ()
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.components.BaseEntityComponent
abstract void updated (float deltaTime)
 
abstract void destroyed ()
 
abstract void activeStateChanged ()
 

Detailed Description

This is the base component of enemy attack logics. A specific handling of enemy attack behavior should derive from this class to be used by the Enemy class

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ BaseEnemyAttackComponent()

com.mygdx.game.components.attacking.BaseEnemyAttackComponent.BaseEnemyAttackComponent ( float  dmg,
int  rangeInTiles 
)

Member Function Documentation

◆ attack()

void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.attack ( HealthComponent  hc)

Requests the component to attack the given HealthComponent

Parameters
hcis the health component to attack

◆ attackCall()

abstract void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.attackCall ( HealthComponent  hc)
abstractprotected

Is called when an attack request is put on the component

Parameters
hcis the HealthComponent to attack.

◆ destroyed()

void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.destroyed ( )
protected

◆ getAnimationComponent()

AnimationComponent com.mygdx.game.components.attacking.BaseEnemyAttackComponent.getAnimationComponent ( )
protected

Returns the animationComponent given to this component in the 'setAnimationComponent' to use to visualize the attacking with

Returns
The AnimationComponent given using the 'setAnimationComponent' method

◆ getDamage()

float com.mygdx.game.components.attacking.BaseEnemyAttackComponent.getDamage ( )

Returns the damage each attack would inflict on a health component

Returns
the damage this component would do with each attack as float

◆ getRangeInTiles()

int com.mygdx.game.components.attacking.BaseEnemyAttackComponent.getRangeInTiles ( )

Returns the amount of tiles this component has attacking range to.

Returns
The attack range in y tiles as integer

◆ isAttacking()

abstract boolean com.mygdx.game.components.attacking.BaseEnemyAttackComponent.isAttacking ( )
abstract

Returns whether this component is in its attack handeling after the 'attack' method was called

Returns
true if its attacking, else false.

◆ setAnimationComponent()

void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.setAnimationComponent ( AnimationComponent  animationComponent)

Sets the animation component this component can use to visualize the attacking motion

Parameters
animationComponentto give this component to visualize the attack with

◆ stopAttacking()

void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.stopAttacking ( )

Stops the attacking on the healthcomponent given in the 'attack' method

◆ stopAttackingCall()

abstract void com.mygdx.game.components.attacking.BaseEnemyAttackComponent.stopAttackingCall ( )
abstractprotected

Is called when an stop attacking request is put on the component

Member Data Documentation

◆ STARTED_ATTACKING_EVENT

final String com.mygdx.game.components.attacking.BaseEnemyAttackComponent.STARTED_ATTACKING_EVENT = "StartedAttackingEvent"
static

◆ STOPPED_ATTACKING_EVENT

final String com.mygdx.game.components.attacking.BaseEnemyAttackComponent.STOPPED_ATTACKING_EVENT = "StoppedAttackingEvent"
static

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