Bandidos
Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.engine.entities.BaseEntity Class Referenceabstract
Inheritance diagram for com.mygdx.game.engine.entities.BaseEntity:
com.mygdx.game.engine.events.EventDispatcher com.mygdx.game.engine.entities.TextEntity com.mygdx.game.entities.BasicEntity com.mygdx.game.entities.ButtonEntity com.mygdx.game.entities.Effect com.mygdx.game.entities.Enemy com.mygdx.game.entities.Player com.mygdx.game.entities.Train com.mygdx.game.entities.weapons.BaseWeapon com.mygdx.game.entities.weapons.projectiles.BaseProjectile com.mygdx.game.level.PlayerBase com.mygdx.game.popUpSystem.BasePopUp com.mygdx.game.traps.TrapActivator com.mygdx.game.traps.TrapSpawn com.mygdx.game.traps.types.BaseTrap com.mygdx.game.traps.types.ExplosiveBarrel com.mygdx.game.tutorial.BowDemonstrationTutorial com.mygdx.game.ui.HealthUI com.mygdx.game.ui.ScoreUI com.mygdx.game.ui.WaveUI

Public Member Functions

 BaseEntity ()
 
TransformComponent getTransformComponent ()
 
boolean hasInstanceOfComponent (BaseEntityComponent componentInstance)
 
void addTag (String tag)
 
void removeTag (String tag)
 
boolean hasTag (String tag)
 
void update (float dt)
 
void render (RenderComponents renderComponents)
 
void destroy ()
 
boolean isDestroyed ()
 
- 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 awake ()
 
abstract void updated (float dt)
 
abstract void rendered (RenderComponents renderComponents)
 
abstract void destroyed ()
 

Detailed Description

This class must be extended to be part of the EntitySystem. It will allow the class to be found by tag, to be updated and to have EntityComponents.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ BaseEntity()

com.mygdx.game.engine.entities.BaseEntity.BaseEntity ( )

Member Function Documentation

◆ addTag()

void com.mygdx.game.engine.entities.BaseEntity.addTag ( String  tag)

Adds a tag to the entity which can be used to be located by the 'EntitySystem' It will not be added if the tag is already on the entity.

Parameters
tagto attach to the entity.

◆ awake()

abstract void com.mygdx.game.engine.entities.BaseEntity.awake ( )
abstractprotected

Is called when the Entity is instantiated.

◆ destroy()

void com.mygdx.game.engine.entities.BaseEntity.destroy ( )

This method will destroy the entity. This can also be done through the method EntitySystem.destroyEntity();

◆ destroyed()

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

Will be called when the entity is in its final destroy phase

◆ getTransformComponent()

TransformComponent com.mygdx.game.engine.entities.BaseEntity.getTransformComponent ( )

Returns the automatically TransformComponent of the Entity

Returns
The default TransformComponent.

◆ hasInstanceOfComponent()

boolean com.mygdx.game.engine.entities.BaseEntity.hasInstanceOfComponent ( BaseEntityComponent  componentInstance)

Checks whether the entity has the same instance of the component as the one given.

Parameters
componentInstranceto check
Returns
'true' if it has the components instance else 'false'

◆ hasTag()

boolean com.mygdx.game.engine.entities.BaseEntity.hasTag ( String  tag)

Returns whether the entity has the given tag.

Parameters
tagto check
Returns
'true' if it has the given tag else it returns 'false'

◆ isDestroyed()

boolean com.mygdx.game.engine.entities.BaseEntity.isDestroyed ( )

Returns true if this entity has been destroyed this frame, else false

Returns
true if this entity has been destroyed this frame, else false

◆ removeTag()

void com.mygdx.game.engine.entities.BaseEntity.removeTag ( String  tag)

Removes the given tag from the entity if it has it.

Parameters
tagto remove from entity

◆ render()

void com.mygdx.game.engine.entities.BaseEntity.render ( RenderComponents  renderComponents)

This method will be called every render update by the EntitySystem for as long as the entity is active.

Parameters
renderComponentswhich contains all the render information

◆ rendered()

abstract void com.mygdx.game.engine.entities.BaseEntity.rendered ( RenderComponents  renderComponents)
abstractprotected

Is called every render update. This method can be used to draw things which are not entities. NOTE: This method will only be called if this entity has a RenderComponent attached to it!

Parameters
renderComponentswhich contains all the render informations

◆ update()

void com.mygdx.game.engine.entities.BaseEntity.update ( float  dt)

This method will be called every frame by the EntitySystem for as long as the entity is active.

Parameters
dtequals the delta time which has passed between the frames

◆ updated()

abstract void com.mygdx.game.engine.entities.BaseEntity.updated ( float  dt)
abstractprotected

Will be called every frame for as long as the entity is active.

Parameters
dtequals the delta time which has passed between the frames

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