Bandidos
Classes | Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.engine.entities.components.BaseEntityComponent Class Referenceabstract
Inheritance diagram for com.mygdx.game.engine.entities.components.BaseEntityComponent:
com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.components.attacking.BaseEnemyAttackComponent com.mygdx.game.components.enemyEffects.EnemyFreezeComponent com.mygdx.game.components.enemyEffects.EnemyPoisonComponent com.mygdx.game.components.ExplosiveComponent com.mygdx.game.components.GridUserComponent com.mygdx.game.components.HealthComponent com.mygdx.game.components.PlayerWeaponControlComponent com.mygdx.game.engine.entities.components.collision.CollisionComponent com.mygdx.game.engine.entities.components.rendering.RenderComponent com.mygdx.game.engine.entities.components.TransformComponent com.mygdx.game.score.ScoreHolderComponent

Classes

enum  TweenStartType
 

Public Member Functions

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 ()
 

Protected Member Functions

abstract void updated (float deltaTime)
 
abstract void destroyed ()
 
abstract void activeStateChanged ()
 

Detailed Description

This class must be inherited by a class for it to be able to be added to Entities as component. It also cleans all its listeners when it is destroyed.

Author
Ramses Di Perna

Member Function Documentation

◆ activeStateChanged()

abstract void com.mygdx.game.engine.entities.components.BaseEntityComponent.activeStateChanged ( )
abstractprotected

This will be called when the active state of the component has been changed.

◆ awake()

abstract void com.mygdx.game.engine.entities.components.BaseEntityComponent.awake ( )
abstract

This will be called when the component is initialized

◆ destroy()

void com.mygdx.game.engine.entities.components.BaseEntityComponent.destroy ( )

Destroys the component. This will automatically be called when it is removed from its parent entity

◆ destroyed()

abstract void com.mygdx.game.engine.entities.components.BaseEntityComponent.destroyed ( )
abstractprotected

This will be called when the component is about to be destroyed / removed from the parent entity

◆ doFloat()

EngineTween com.mygdx.game.engine.entities.components.BaseEntityComponent.doFloat ( TweenableFloat  floatToTween,
float  newValue,
float  duration,
TweenStartType  tweenStartType 
)

◆ getParentOfComponent()

BaseEntity com.mygdx.game.engine.entities.components.BaseEntityComponent.getParentOfComponent ( )

Returns the parent of the component given in the 'initialize' method

Returns
the parent entity of the component.

◆ initialize()

void com.mygdx.game.engine.entities.components.BaseEntityComponent.initialize ( BaseEntity  parentEntity)

Initializes the component to set its correct properties. This method can only be called once.

Parameters
parentEntityof the component. (To which entity the component is attached to)

◆ isActive()

boolean com.mygdx.game.engine.entities.components.BaseEntityComponent.isActive ( )

Returns if the component is active or not active. When it is not active, the component will not be updated and other functionalities can also be turned off

Returns
The components active state. If active, this will return true, else it returns false.

◆ isDestroyed()

boolean com.mygdx.game.engine.entities.components.BaseEntityComponent.isDestroyed ( )

Returns if this component has been destroyed

Returns
True if component has been destroyed, else false

◆ setActiveState()

void com.mygdx.game.engine.entities.components.BaseEntityComponent.setActiveState ( boolean  activeState)

◆ startTimelineOnComponent()

Timeline com.mygdx.game.engine.entities.components.BaseEntityComponent.startTimelineOnComponent ( Timeline  timeline,
boolean  updateInGameTime 
)

Starts a timeline on this component which will be ended automatically when this component is destroyed

Parameters
timelineto start on component
updateInGameTimeif true, the speed will be affected by the Engine.TimeScale, if false, it will run on real time seconds
Returns
The Timeline which was started on this component.

◆ startTweenOnComponent()

EngineTween com.mygdx.game.engine.entities.components.BaseEntityComponent.startTweenOnComponent ( Tween  tween,
TweenStartType  tweenStartType 
)

Starts a tween on this component which will be ended automatically when this component is destroyed.

Parameters
tweento start on component
updateInGameTimeif true, the speed will be affected by the Engine.TimeScale, if false, it will run on real time seconds
Returns
The EngineTween which is created out of the tween & started on this component.

◆ stopAllComponentTweens()

void com.mygdx.game.engine.entities.components.BaseEntityComponent.stopAllComponentTweens ( )

Stops all the tweens & TimeLines started on this component.

◆ update()

void com.mygdx.game.engine.entities.components.BaseEntityComponent.update ( float  deltaTime)

◆ updated()

abstract void com.mygdx.game.engine.entities.components.BaseEntityComponent.updated ( float  deltaTime)
abstractprotected

This will be called every frame for as long as the component is attached to the entity.

Parameters
deltaTimeof how much time passed between this frame and the last.

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