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

Public Member Functions

 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 ()
 
- Public Member Functions inherited from com.mygdx.game.traps.ITrap
int getSizeX ()
 
int getSizeY ()
 
boolean canBeActive ()
 
void refresh ()
 

Protected Member Functions

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

Detailed Description

This is the base class for all the traps in the game.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ BaseTrap()

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

Member Function Documentation

◆ destroyed()

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

◆ doEffect()

abstract void com.mygdx.game.traps.types.BaseTrap.doEffect ( )
abstractprotected

This is triggered when the trap is triggered * it was allowed to be triggered by the 'canBeTriggered()' method

◆ getDirection()

TrapFactory.Direction com.mygdx.game.traps.types.BaseTrap.getDirection ( )

Returns the direction which the trap is facing.

Returns
The direction the trap is facing

◆ getGrid()

Grid com.mygdx.game.traps.types.BaseTrap.getGrid ( )
protected

Returns the grid the trap is placed on

Returns
The grid the trap is placed on

◆ getGridUserComponent()

GridUserComponent com.mygdx.game.traps.types.BaseTrap.getGridUserComponent ( )
protected

The Grid user component the traps use to effect the state of the tiles on the grid and to be placed on them

Returns
The GridUserComponent of the trap

◆ place()

int com.mygdx.game.traps.types.BaseTrap.place ( int  gridXPos,
int  gridYPos 
)

Places the trap on the grid and sets the transform location on the tile its world location

Parameters
gridXPosis the x position as grid index (x axis)
gridYPosis the y position as grid index (y axis)
Returns
Far left side of the trap in grid position

◆ trigger()

void com.mygdx.game.traps.types.BaseTrap.trigger ( )

Here the effect will be triggered of the trap

Implements com.mygdx.game.traps.ITrap.


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