Sky Zone Omega - PC Version
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
E_EntityManager Class Reference

A class that manages all of the entities in the game with the exception of the player. More...

#include <E_EntityManager.h>

Collaboration diagram for E_EntityManager:
Collaboration graph

Public Member Functions

 E_EntityManager (C_Vec2 dimensions, EP_Player *player, SDL_Renderer *renderer, C_Texture *fireSprite, SDL_Colour minFireTint, SDL_Colour maxFireTint, float *universalSpeed)
 Constructs the Entity Manager. More...
 
 ~E_EntityManager ()
 Destructs the Entity Manager. More...
 
void update (float dt)
 A function to update the Entities. More...
 
void draw ()
 A function to draw the Entities to the screen. More...
 
C_TexturegetTexture (std::string iD)
 Gets the pointer to the wanted texture. More...
 
C_Vec2 getEntityDimensions (std::string iD)
 Gets the dimensions of the wanted entity. More...
 
std::vector< EE_StyphBird * > getStyphBirds ()
 Gets the vector array of StyphBird pointers. More...
 
std::vector< EE_StormCloud * > getStormClouds ()
 Gets the vector array of StormCloud pointers. More...
 
std::vector< EE_Archer * > getArchers ()
 Gets the vector array of Archer pointers. More...
 
std::vector< EPU_Coin * > getCoins ()
 Gets the vector array of Coin pointers. More...
 
std::vector< EPU_Health * > getHealthPickups ()
 Gets the vector array of Health pointers. More...
 
std::vector< EPU_Flaming * > getFlamingPickups ()
 Gets the vector array of Flaming pointers. More...
 
std::vector< EPU_KillAll * > getKillAllPickups ()
 Gets the vector array of KillAll pointers. More...
 
std::vector< EPU_CoinAll * > getCoinAllPickups ()
 Gets the vector array of CoinAll pointers. More...
 
std::vector< EPU_Shield * > getShieldPickups ()
 Gets the vector array of Shield pointers. More...
 
std::vector< EPU_TimeSlow * > getTimeSlowPickups ()
 Gets the vector array of TimeSlow pointers. More...
 
std::vector< EA_PlayerArrow * > getPlayerArrows ()
 Gets the vector array of PlayerArrow pointers. More...
 
std::vector< EA_FlamingArrow * > getFlamingArrows ()
 Gets the vector array of FlamingArrow pointers. More...
 
std::vector< EA_ArcherArrow * > getArcherArrows ()
 Gets the vector array of ArcherArrow pointers. More...
 
void playCoinCollectSound ()
 Plays the coin collect sound. More...
 
void playHealthCollectSound ()
 Plays the health collect sound. More...
 
void playShieldCollectSound ()
 Plays the shield collect sound. More...
 
void playCoinKillAllCollectSound ()
 Plays the coin and kill all collect sound. More...
 
void playFireCollectSound ()
 Plays the fire collect sound. More...
 
void playTimeSlowCollectSound ()
 Plays the time slow collect sound. More...
 
void playEnemyDeathSound ()
 Plays the enemy death sound. More...
 
void playEnemyHitSound ()
 Plays the enemy hit sound. More...
 
void spawnStyphBird (C_Vec2 spawnPos)
 Spawn a new StyphBird. More...
 
void spawnStormCloud (C_Vec2 spawnPos)
 Spawn a new StormCloud. More...
 
void spawnArcher (C_Vec2 spawnPos)
 Spawn a new Archer. More...
 
void spawnCoin (C_Vec2 spawnPos)
 Spawn a new Coin. More...
 
void spawnHealth (C_Vec2 spawnPos)
 Spawn a new Health pickup. More...
 
void spawnFlaming (C_Vec2 spawnPos)
 Spawn a new Flaming pickup. More...
 
void spawnCoinAll (C_Vec2 spawnPos)
 Spawn a new CoinAll pickup. More...
 
void spawnKillAll (C_Vec2 spawnPos)
 Spawn a new KillAll pickup. More...
 
void spawnShield (C_Vec2 spawnPos)
 Spawn a new Shield pickup. More...
 
void spawnTimeSlow (C_Vec2 spawnPos)
 Spawn a new TimeSlow pickup. More...
 

Private Member Functions

void removeDeadEntites ()
 A function that deletes all of the entities flagged as dead. More...
 
void createDeathEffects (C_Vec2 entityPos, C_Vec2 entityVelocity, C_Vec2 deadEntityDimensions, bool coinSpawn, int maxCoins, std::string entityType)
 A function that creates the particle effects for if the entities are killed. More...
 
void removeCompletedEffects ()
 A function that deletes all of the entities flagged as dead. More...
 

Private Attributes

C_Vec2 screenDimensions
 The screen dimensions. More...
 
SDL_Renderer * renderer
 A pointer to the renderer. More...
 
EP_Playerplayer
 A pointer to the Player. More...
 
std::unordered_map
< std::string, C_Texture * > 
textures
 An unordered map of the sprite textures. More...
 
std::unordered_map
< std::string, C_Vec2
entityDimensions
 An unordered map of the entity dimensions. More...
 
float * universalSpeed
 A pointer for the universal speed of the game. More...
 
std::vector< EE_StyphBird * > styphBirds
 The vector array of StyphBirds. More...
 
std::vector< EE_StormCloud * > stormClouds
 The vector array of Storm Clouds. More...
 
std::vector< EE_Archer * > archers
 The vector array of Archers. More...
 
std::vector< EPU_Coin * > coins
 The vector array of Coins. More...
 
std::vector< EPU_Health * > healthPickups
 The vector array of Health. More...
 
std::vector< EPU_Flaming * > flamingPickups
 The vector array of Flaming power ups. More...
 
std::vector< EPU_KillAll * > killAllPickups
 The vector array of killAll power ups. More...
 
std::vector< EPU_CoinAll * > coinAllPickups
 The vector array of coinAll power ups. More...
 
std::vector< EPU_Shield * > shieldPickups
 The vector array of shield. More...
 
std::vector< EPU_TimeSlow * > timeSlowPickups
 The vector array of TimeSlow power ups. More...
 
std::vector< EA_PlayerArrow * > playerArrows
 The vector array of Player Arrows. More...
 
std::vector< EA_FlamingArrow * > flamingArrows
 The vector array of Flaming Arrows. More...
 
std::vector< EA_ArcherArrow * > archerArrows
 The vector array of Archer Arrows. More...
 
std::unordered_map
< std::string, SDL_Colour > 
minColourTints
 An unordered map of min tint colours for use with the particle effects. More...
 
std::unordered_map
< std::string, SDL_Colour > 
maxColourTints
 An unordered map of max tint colours for use with the particle effects. More...
 
std::vector< PS_ParticleEffect * > deathEffects
 The vector array of particle effects for use with entity death. More...
 
C_AudioarrowShotSound
 The arrow shot sound effect. More...
 
C_AudiofireArrowShotSound
 The fire arrow shot sound effect. More...
 
C_AudiohealthCollectSound
 The health collect sound effect. More...
 
C_AudiocoinCollectSound
 The coin collect sound effect. More...
 
C_AudioshieldCollectSound
 The shield collect sound effect. More...
 
C_AudiocoinKillAllCollectSound
 The coin all and the kill all collect sound effect. More...
 
C_AudiofireCollectSound
 The fire collect sound effect. More...
 
C_AudiotimeSlowCollectSound
 The time slow collect sound effect. More...
 
C_AudioenemyDeathSound
 The enemy death sound effect. More...
 
C_AudioenemyHitSound
 The enemy hit sound effect. More...
 

Detailed Description

A class that manages all of the entities in the game with the exception of the player.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

E_EntityManager::E_EntityManager ( C_Vec2  dimensions,
EP_Player player,
SDL_Renderer *  renderer,
C_Texture fireSprite,
SDL_Colour  minFireTint,
SDL_Colour  maxFireTint,
float *  universalSpeed 
)

Constructs the Entity Manager.

Parameters
dimensionsThe screen dimensions.
playerA pointer to the player.
rendererA pointer to the renderer.
fireSpriteA pointer to the particles Texture.
minTintThe minimum tint for the fire particles.
maxTintThe maximum tint for the fire particles.
universalSpeedA pointer for the universal speed of the game.
E_EntityManager::~E_EntityManager ( )

Destructs the Entity Manager.

Member Function Documentation

void E_EntityManager::createDeathEffects ( C_Vec2  entityPos,
C_Vec2  entityVelocity,
C_Vec2  deadEntityDimensions,
bool  coinSpawn,
int  maxCoins,
std::string  entityType 
)
private

A function that creates the particle effects for if the entities are killed.

Parameters
entityPosThe position of the entity.
entityVelocityThe Velocity of the entity.
deadEntityDimensionsThe dimensions of the Entity.
coinSpawnA boolean for if the entity should spawn coins.
maxCoinsThe max number of coins to spawn.
entityTypeThe name of the type of entity that is killed.

Here is the caller graph for this function:

void E_EntityManager::draw ( )

A function to draw the Entities to the screen.

Here is the caller graph for this function:

std::vector< EA_ArcherArrow * > E_EntityManager::getArcherArrows ( )

Gets the vector array of ArcherArrow pointers.

Returns
The vector array of ArcherArrow pointers

Here is the caller graph for this function:

std::vector< EE_Archer * > E_EntityManager::getArchers ( )

Gets the vector array of Archer pointers.

Returns
The vector array of Archer pointers

Here is the caller graph for this function:

std::vector< EPU_CoinAll * > E_EntityManager::getCoinAllPickups ( )

Gets the vector array of CoinAll pointers.

Returns
The vector array of CoinAll pointers

Here is the caller graph for this function:

std::vector< EPU_Coin * > E_EntityManager::getCoins ( )

Gets the vector array of Coin pointers.

Returns
The vector array of Coin pointers

Here is the caller graph for this function:

C_Vec2 E_EntityManager::getEntityDimensions ( std::string  iD)

Gets the dimensions of the wanted entity.

Parameters
iDThe ID of the dimensions to return.
Returns
The dimensions of the wanted entity.

Here is the caller graph for this function:

std::vector< EA_FlamingArrow * > E_EntityManager::getFlamingArrows ( )

Gets the vector array of FlamingArrow pointers.

Returns
The vector array of FlamingArrow pointers

Here is the caller graph for this function:

std::vector< EPU_Flaming * > E_EntityManager::getFlamingPickups ( )

Gets the vector array of Flaming pointers.

Returns
The vector array of Flaming pointers

Here is the caller graph for this function:

std::vector< EPU_Health * > E_EntityManager::getHealthPickups ( )

Gets the vector array of Health pointers.

Returns
The vector array of Health pointers

Here is the caller graph for this function:

std::vector< EPU_KillAll * > E_EntityManager::getKillAllPickups ( )

Gets the vector array of KillAll pointers.

Returns
The vector array of KillAll pointers

Here is the caller graph for this function:

std::vector< EA_PlayerArrow * > E_EntityManager::getPlayerArrows ( )

Gets the vector array of PlayerArrow pointers.

Returns
The vector array of PlayerArrow pointers

Here is the caller graph for this function:

std::vector< EPU_Shield * > E_EntityManager::getShieldPickups ( )

Gets the vector array of Shield pointers.

Returns
The vector array of Shield pointers

Here is the caller graph for this function:

std::vector< EE_StormCloud * > E_EntityManager::getStormClouds ( )

Gets the vector array of StormCloud pointers.

Returns
The vector array of StormCloud pointers

Here is the caller graph for this function:

std::vector< EE_StyphBird * > E_EntityManager::getStyphBirds ( )

Gets the vector array of StyphBird pointers.

Returns
The vector array of StyphBird pointers

Here is the caller graph for this function:

C_Texture * E_EntityManager::getTexture ( std::string  iD)

Gets the pointer to the wanted texture.

Parameters
iDThe ID of the texture to return.
Returns
The pointer to the wanted texture.

Here is the caller graph for this function:

std::vector< EPU_TimeSlow * > E_EntityManager::getTimeSlowPickups ( )

Gets the vector array of TimeSlow pointers.

Returns
The vector array of TimeSlow pointers

Here is the caller graph for this function:

void E_EntityManager::playCoinCollectSound ( )

Plays the coin collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playCoinKillAllCollectSound ( )

Plays the coin and kill all collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playEnemyDeathSound ( )

Plays the enemy death sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playEnemyHitSound ( )

Plays the enemy hit sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playFireCollectSound ( )

Plays the fire collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playHealthCollectSound ( )

Plays the health collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playShieldCollectSound ( )

Plays the shield collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::playTimeSlowCollectSound ( )

Plays the time slow collect sound.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::removeCompletedEffects ( )
private

A function that deletes all of the entities flagged as dead.

Here is the caller graph for this function:

void E_EntityManager::removeDeadEntites ( )
private

A function that deletes all of the entities flagged as dead.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnArcher ( C_Vec2  spawnPos)

Spawn a new Archer.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnCoin ( C_Vec2  spawnPos)

Spawn a new Coin.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnCoinAll ( C_Vec2  spawnPos)

Spawn a new CoinAll pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnFlaming ( C_Vec2  spawnPos)

Spawn a new Flaming pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnHealth ( C_Vec2  spawnPos)

Spawn a new Health pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnKillAll ( C_Vec2  spawnPos)

Spawn a new KillAll pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnShield ( C_Vec2  spawnPos)

Spawn a new Shield pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnStormCloud ( C_Vec2  spawnPos)

Spawn a new StormCloud.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnStyphBird ( C_Vec2  spawnPos)

Spawn a new StyphBird.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::spawnTimeSlow ( C_Vec2  spawnPos)

Spawn a new TimeSlow pickup.

Parameters
spawnPosThe position to spawn at.

Here is the call graph for this function:

Here is the caller graph for this function:

void E_EntityManager::update ( float  dt)

A function to update the Entities.

Parameters
dtThe delta time.

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector<EA_ArcherArrow*> E_EntityManager::archerArrows
private

The vector array of Archer Arrows.

std::vector<EE_Archer*> E_EntityManager::archers
private

The vector array of Archers.

C_Audio* E_EntityManager::arrowShotSound
private

The arrow shot sound effect.

std::vector<EPU_CoinAll*> E_EntityManager::coinAllPickups
private

The vector array of coinAll power ups.

C_Audio* E_EntityManager::coinCollectSound
private

The coin collect sound effect.

C_Audio* E_EntityManager::coinKillAllCollectSound
private

The coin all and the kill all collect sound effect.

std::vector<EPU_Coin*> E_EntityManager::coins
private

The vector array of Coins.

std::vector<PS_ParticleEffect*> E_EntityManager::deathEffects
private

The vector array of particle effects for use with entity death.

C_Audio* E_EntityManager::enemyDeathSound
private

The enemy death sound effect.

C_Audio* E_EntityManager::enemyHitSound
private

The enemy hit sound effect.

std::unordered_map<std::string, C_Vec2> E_EntityManager::entityDimensions
private

An unordered map of the entity dimensions.

C_Audio* E_EntityManager::fireArrowShotSound
private

The fire arrow shot sound effect.

C_Audio* E_EntityManager::fireCollectSound
private

The fire collect sound effect.

std::vector<EA_FlamingArrow*> E_EntityManager::flamingArrows
private

The vector array of Flaming Arrows.

std::vector<EPU_Flaming*> E_EntityManager::flamingPickups
private

The vector array of Flaming power ups.

C_Audio* E_EntityManager::healthCollectSound
private

The health collect sound effect.

std::vector<EPU_Health*> E_EntityManager::healthPickups
private

The vector array of Health.

std::vector<EPU_KillAll*> E_EntityManager::killAllPickups
private

The vector array of killAll power ups.

std::unordered_map<std::string, SDL_Colour> E_EntityManager::maxColourTints
private

An unordered map of max tint colours for use with the particle effects.

std::unordered_map<std::string, SDL_Colour> E_EntityManager::minColourTints
private

An unordered map of min tint colours for use with the particle effects.

EP_Player* E_EntityManager::player
private

A pointer to the Player.

std::vector<EA_PlayerArrow*> E_EntityManager::playerArrows
private

The vector array of Player Arrows.

SDL_Renderer* E_EntityManager::renderer
private

A pointer to the renderer.

C_Vec2 E_EntityManager::screenDimensions
private

The screen dimensions.

C_Audio* E_EntityManager::shieldCollectSound
private

The shield collect sound effect.

std::vector<EPU_Shield*> E_EntityManager::shieldPickups
private

The vector array of shield.

std::vector<EE_StormCloud*> E_EntityManager::stormClouds
private

The vector array of Storm Clouds.

std::vector<EE_StyphBird*> E_EntityManager::styphBirds
private

The vector array of StyphBirds.

std::unordered_map<std::string, C_Texture*> E_EntityManager::textures
private

An unordered map of the sprite textures.

C_Audio* E_EntityManager::timeSlowCollectSound
private

The time slow collect sound effect.

std::vector<EPU_TimeSlow*> E_EntityManager::timeSlowPickups
private

The vector array of TimeSlow power ups.

float* E_EntityManager::universalSpeed
private

A pointer for the universal speed of the game.


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