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

Public Member Functions

 TrapActivator (ITrap trapToLink)
 
void linkToTrap (ITrap trapToLink)
 
boolean isActivatorActive ()
 
void onReceiveEvent (Event event)
 
Vector2 getLocalTargetLocation ()
 
void activateTrap ()
 
void deactivateTrap ()
 
boolean isProcessingActivationRequest ()
 
- 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 is an entity which allows for interaction between projectiles and traps. When this entity is hit by a projectile, the linked trap will be triggered.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ TrapActivator()

com.mygdx.game.traps.TrapActivator.TrapActivator ( ITrap  trapToLink)

The trap activator needs to be linked to a trap in order to trigger it on activation.

Parameters
trapToLinkTrap to link to the activator

Member Function Documentation

◆ activateTrap()

void com.mygdx.game.traps.TrapActivator.activateTrap ( )

Activates the trap activator. Making it able to be hit & triggered. If the trap is not able to be activated at this frame, this activator will wait until it is and then activate itself.

◆ awake()

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

◆ deactivateTrap()

void com.mygdx.game.traps.TrapActivator.deactivateTrap ( )

Deactivates the trap activator. Making it unable to be hit & triggered.

◆ destroyed()

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

◆ getLocalTargetLocation()

Vector2 com.mygdx.game.traps.TrapActivator.getLocalTargetLocation ( )

Returns the local position of the target of this activator (The bullseye)

Returns
The target location in its local space.

◆ isActivatorActive()

boolean com.mygdx.game.traps.TrapActivator.isActivatorActive ( )

◆ isProcessingActivationRequest()

boolean com.mygdx.game.traps.TrapActivator.isProcessingActivationRequest ( )

◆ linkToTrap()

void com.mygdx.game.traps.TrapActivator.linkToTrap ( ITrap  trapToLink)

Links a trap to the activator so it can trigger it on activation.

Parameters
trapToLinkTrap to link to the activator

◆ onReceiveEvent()

void com.mygdx.game.traps.TrapActivator.onReceiveEvent ( Event  event)

This will be triggered when an event has been fired of type which this implementing class was listening to.

Parameters
eventwhich has one of the event types which is listened to.

Implements com.mygdx.game.engine.events.IEventReceiver.

◆ rendered()

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

◆ updated()

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

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