Bandidos
Public Member Functions | Protected Member Functions | List of all members
com.mygdx.game.traps.TrapSpawn Class Reference
Inheritance diagram for com.mygdx.game.traps.TrapSpawn:
com.mygdx.game.engine.entities.BaseEntity com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

 TrapSpawn (TrapSpawnInfo info, Grid grid)
 
void spawnTrap (float activatorPosition)
 
void countForResetTrap ()
 
void forceResetTrap ()
 
TrapActivator getTrapActivator ()
 
- Public Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
 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

void awake ()
 
void updated (float dt)
 
void rendered (RenderComponents renderComponents)
 
void destroyed ()
 
- Protected Member Functions inherited from com.mygdx.game.engine.entities.BaseEntity
abstract void awake ()
 
abstract void updated (float dt)
 
abstract void rendered (RenderComponents renderComponents)
 
abstract void destroyed ()
 

Detailed Description

This class is responsible for spawning the correct trap in the correct manner when its 'spawnTrap' method is called. This will handle the trap's orientation, location and spawning + linking the trap activator correctly

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ TrapSpawn()

com.mygdx.game.traps.TrapSpawn.TrapSpawn ( TrapSpawnInfo  info,
Grid  grid 
)

The TrapSpawn needs get information on what traps its able to spawn and on what grid. It positions itself using the info given.

Parameters
infocontaining the information of the traps it can spawn.
gridto spawn the traps on and to give to the traps.

Member Function Documentation

◆ awake()

void com.mygdx.game.traps.TrapSpawn.awake ( )
protected

◆ countForResetTrap()

void com.mygdx.game.traps.TrapSpawn.countForResetTrap ( )

Counts a tick which is set for this TrapSpawn to wait until it can reset the trap. (Tick amount gotten from the TrapFactory)

◆ destroyed()

void com.mygdx.game.traps.TrapSpawn.destroyed ( )
protected

◆ forceResetTrap()

void com.mygdx.game.traps.TrapSpawn.forceResetTrap ( )

Resets the Trap spawned by this TrapSpawn

◆ getTrapActivator()

TrapActivator com.mygdx.game.traps.TrapSpawn.getTrapActivator ( )

Returns the TrapActivator spawned by this TrapSpawn and which is linked to the Trap of this TrapSpawn

Returns
TrapActivator spawned by this TrapSpawn

◆ rendered()

void com.mygdx.game.traps.TrapSpawn.rendered ( RenderComponents  renderComponents)
protected

◆ spawnTrap()

void com.mygdx.game.traps.TrapSpawn.spawnTrap ( float  activatorPosition)

Spawns a trap and trap activator and positions them and links them.

◆ updated()

void com.mygdx.game.traps.TrapSpawn.updated ( float  dt)
protected

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