Bandidos
Public Member Functions | Static Public Attributes | List of all members
com.mygdx.game.waves.WaveSystem Class Reference
Inheritance diagram for com.mygdx.game.waves.WaveSystem:
com.mygdx.game.engine.events.EventDispatcher

Public Member Functions

 WaveSystem (Playfield playfield, IWaveDesigns waveDesigns)
 
int getCurrentWave ()
 
int getCurrentWaveType ()
 
void updateWaveSystem (float deltaTime)
 
Enemy waveCreateEnemy (Wave wave, EnemyFactory.EnemyType enemyType)
 
void clean ()
 
- 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 String EVENT_WAVE_STARTED = "WaveStartedEvent"
 

Detailed Description

The wave system is a system which tracks the current wave and switches to the next wave. It also spawns enemies on request and gives those enemies the components to work as 'wave slaves'.

Author
Ramses Di Perna

Constructor & Destructor Documentation

◆ WaveSystem()

com.mygdx.game.waves.WaveSystem.WaveSystem ( Playfield  playfield,
IWaveDesigns  waveDesigns 
)

This gives the tools needed for the WaveSystem to work

Parameters
playfieldto give to the enemies as reference and to spawn the enemies on
waveDesignsto get waves from which are perfectly designed with the information given to them

Member Function Documentation

◆ clean()

void com.mygdx.game.waves.WaveSystem.clean ( )

Prepares the system for Garbage Collection.

◆ getCurrentWave()

int com.mygdx.game.waves.WaveSystem.getCurrentWave ( )

Returns the wave number which is active

Returns
The current wave as integer

◆ getCurrentWaveType()

int com.mygdx.game.waves.WaveSystem.getCurrentWaveType ( )

Gets the type of wave currently active

Returns
Wave Type as integer

◆ updateWaveSystem()

void com.mygdx.game.waves.WaveSystem.updateWaveSystem ( float  deltaTime)

Updates the system and makes it so all functionalities work perfectly together. NOTE: This method should be called every frame in order for the system to work!

Parameters
deltaTimerepresents the time which has passed between the last frame and the current

◆ waveCreateEnemy()

Enemy com.mygdx.game.waves.WaveSystem.waveCreateEnemy ( Wave  wave,
EnemyFactory.EnemyType  enemyType 
)

Creates an enemy for the current wave if the current wave instance is given. Else it does nothing.

Parameters
wavewhich is the caller and the current active wave
enemyTypeto spawn

Member Data Documentation

◆ EVENT_WAVE_STARTED

final String com.mygdx.game.waves.WaveSystem.EVENT_WAVE_STARTED = "WaveStartedEvent"
static

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