Bandidos
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
com.mygdx.game.traps.types.TrainBlockTrap Class Reference
Inheritance diagram for com.mygdx.game.traps.types.TrainBlockTrap:
com.mygdx.game.traps.types.BaseBlockTrap com.mygdx.game.engine.events.IEventReceiver com.mygdx.game.traps.types.BaseTrap com.mygdx.game.engine.entities.BaseEntity com.mygdx.game.traps.ITrap com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

 TrainBlockTrap (Grid grid, Direction direction)
 
int getSizeX ()
 
int getSizeY ()
 
void onReceiveEvent (Event event)
 
boolean canBeActive ()
 
void refresh ()
 
- Public Member Functions inherited from com.mygdx.game.traps.types.BaseBlockTrap
 BaseBlockTrap (Grid grid, TrapFactory.Direction direction)
 
- Public Member Functions inherited from com.mygdx.game.traps.types.BaseTrap
 BaseTrap (Grid grid, TrapFactory.Direction direction)
 
int place (int gridXPos, int gridYPos)
 
TrapFactory.Direction getDirection ()
 
void trigger ()
 
- 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 ()
 

Static Public Attributes

static final float DURATION = 4f
 
static final float COOLDOWN_TIME = DURATION + 8f
 
static final float SPEED = 8
 

Protected Member Functions

void onCollisionEvent (CollisionEvent event)
 
void awake ()
 
void updated (float dt)
 
void rendered (RenderComponents renderComponents)
 
void destroyed ()
 
void doEffect ()
 
void endOfEffect ()
 
- Protected Member Functions inherited from com.mygdx.game.traps.types.BaseBlockTrap
void doEffect ()
 
- Protected Member Functions inherited from com.mygdx.game.traps.types.BaseTrap
void destroyed ()
 
Grid getGrid ()
 
GridUserComponent getGridUserComponent ()
 
abstract void doEffect ()
 
- 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 ()
 

Additional Inherited Members

- Protected Attributes inherited from com.mygdx.game.traps.types.BaseBlockTrap
boolean canBeTriggered = true
 

Detailed Description

This spawns a train track which will spawn a passing train when triggered. Which blocks the way and kills all in its path of fury <3

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ TrainBlockTrap()

com.mygdx.game.traps.types.TrainBlockTrap.TrainBlockTrap ( Grid  grid,
Direction  direction 
)

Member Function Documentation

◆ awake()

void com.mygdx.game.traps.types.TrainBlockTrap.awake ( )
protected

◆ canBeActive()

boolean com.mygdx.game.traps.types.TrainBlockTrap.canBeActive ( )

Indicates whether this trap is allowed to be active. This can be false due to it still running or other reasons the trap gives it

Returns
Whether the trap can be activated. True if it can, else false

Implements com.mygdx.game.traps.ITrap.

◆ destroyed()

void com.mygdx.game.traps.types.TrainBlockTrap.destroyed ( )
protected

◆ doEffect()

void com.mygdx.game.traps.types.TrainBlockTrap.doEffect ( )
protected

◆ endOfEffect()

void com.mygdx.game.traps.types.TrainBlockTrap.endOfEffect ( )
protected

After the train is gone, the train will be destroyed and the grid will be not occupied anymore.

◆ getSizeX()

int com.mygdx.game.traps.types.TrainBlockTrap.getSizeX ( )

The amount of tiles this trap covers in the x axis starting from the left side

Returns
X size in tile amount

Implements com.mygdx.game.traps.ITrap.

◆ getSizeY()

int com.mygdx.game.traps.types.TrainBlockTrap.getSizeY ( )

The amount of tiles this trap covers in the y axis starting from the upper side

Returns
Y size in tile amount

Implements com.mygdx.game.traps.ITrap.

◆ onCollisionEvent()

void com.mygdx.game.traps.types.TrainBlockTrap.onCollisionEvent ( CollisionEvent  event)
protected

◆ onReceiveEvent()

void com.mygdx.game.traps.types.TrainBlockTrap.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.

◆ refresh()

void com.mygdx.game.traps.types.TrainBlockTrap.refresh ( )

Is called when the trap is requested to be available again.

Implements com.mygdx.game.traps.ITrap.

◆ rendered()

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

◆ updated()

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

Member Data Documentation

◆ COOLDOWN_TIME

final float com.mygdx.game.traps.types.TrainBlockTrap.COOLDOWN_TIME = DURATION + 8f
static

◆ DURATION

final float com.mygdx.game.traps.types.TrainBlockTrap.DURATION = 4f
static

◆ SPEED

final float com.mygdx.game.traps.types.TrainBlockTrap.SPEED = 8
static

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