A class that manages all of the entities in the game with the exception of the player. More...
#include <E_EntityManager.h>
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_Texture * | getTexture (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_Player * | player |
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_Audio * | arrowShotSound |
The arrow shot sound effect. More... | |
C_Audio * | fireArrowShotSound |
The fire arrow shot sound effect. More... | |
C_Audio * | healthCollectSound |
The health collect sound effect. More... | |
C_Audio * | coinCollectSound |
The coin collect sound effect. More... | |
C_Audio * | shieldCollectSound |
The shield collect sound effect. More... | |
C_Audio * | coinKillAllCollectSound |
The coin all and the kill all collect sound effect. More... | |
C_Audio * | fireCollectSound |
The fire collect sound effect. More... | |
C_Audio * | timeSlowCollectSound |
The time slow collect sound effect. More... | |
C_Audio * | enemyDeathSound |
The enemy death sound effect. More... | |
C_Audio * | enemyHitSound |
The enemy hit sound effect. More... | |
A class that manages all of the entities in the game with the exception of the player.
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.
dimensions | The screen dimensions. |
player | A pointer to the player. |
renderer | A pointer to the renderer. |
fireSprite | A pointer to the particles Texture. |
minTint | The minimum tint for the fire particles. |
maxTint | The maximum tint for the fire particles. |
universalSpeed | A pointer for the universal speed of the game. |
E_EntityManager::~E_EntityManager | ( | ) |
Destructs the Entity Manager.
|
private |
A function that creates the particle effects for if the entities are killed.
entityPos | The position of the entity. |
entityVelocity | The Velocity of the entity. |
deadEntityDimensions | The dimensions of the Entity. |
coinSpawn | A boolean for if the entity should spawn coins. |
maxCoins | The max number of coins to spawn. |
entityType | The name of the type of entity that is killed. |
void E_EntityManager::draw | ( | ) |
A function to draw the Entities to the screen.
std::vector< EA_ArcherArrow * > E_EntityManager::getArcherArrows | ( | ) |
Gets the vector array of ArcherArrow pointers.
std::vector< EE_Archer * > E_EntityManager::getArchers | ( | ) |
Gets the vector array of Archer pointers.
std::vector< EPU_CoinAll * > E_EntityManager::getCoinAllPickups | ( | ) |
Gets the vector array of CoinAll pointers.
std::vector< EPU_Coin * > E_EntityManager::getCoins | ( | ) |
Gets the vector array of Coin pointers.
C_Vec2 E_EntityManager::getEntityDimensions | ( | std::string | iD | ) |
Gets the dimensions of the wanted entity.
iD | The ID of the dimensions to return. |
std::vector< EA_FlamingArrow * > E_EntityManager::getFlamingArrows | ( | ) |
Gets the vector array of FlamingArrow pointers.
std::vector< EPU_Flaming * > E_EntityManager::getFlamingPickups | ( | ) |
Gets the vector array of Flaming pointers.
std::vector< EPU_Health * > E_EntityManager::getHealthPickups | ( | ) |
Gets the vector array of Health pointers.
std::vector< EPU_KillAll * > E_EntityManager::getKillAllPickups | ( | ) |
Gets the vector array of KillAll pointers.
std::vector< EA_PlayerArrow * > E_EntityManager::getPlayerArrows | ( | ) |
Gets the vector array of PlayerArrow pointers.
std::vector< EPU_Shield * > E_EntityManager::getShieldPickups | ( | ) |
Gets the vector array of Shield pointers.
std::vector< EE_StormCloud * > E_EntityManager::getStormClouds | ( | ) |
Gets the vector array of StormCloud pointers.
std::vector< EE_StyphBird * > E_EntityManager::getStyphBirds | ( | ) |
Gets the vector array of StyphBird pointers.
C_Texture * E_EntityManager::getTexture | ( | std::string | iD | ) |
Gets the pointer to the wanted texture.
iD | The ID of the texture to return. |
std::vector< EPU_TimeSlow * > E_EntityManager::getTimeSlowPickups | ( | ) |
Gets the vector array of TimeSlow pointers.
void E_EntityManager::playCoinCollectSound | ( | ) |
Plays the coin collect sound.
void E_EntityManager::playCoinKillAllCollectSound | ( | ) |
Plays the coin and kill all collect sound.
void E_EntityManager::playEnemyDeathSound | ( | ) |
Plays the enemy death sound.
void E_EntityManager::playEnemyHitSound | ( | ) |
Plays the enemy hit sound.
void E_EntityManager::playFireCollectSound | ( | ) |
Plays the fire collect sound.
void E_EntityManager::playHealthCollectSound | ( | ) |
Plays the health collect sound.
void E_EntityManager::playShieldCollectSound | ( | ) |
Plays the shield collect sound.
void E_EntityManager::playTimeSlowCollectSound | ( | ) |
Plays the time slow collect sound.
|
private |
A function that deletes all of the entities flagged as dead.
|
private |
A function that deletes all of the entities flagged as dead.
void E_EntityManager::spawnArcher | ( | C_Vec2 | spawnPos | ) |
Spawn a new Archer.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnCoin | ( | C_Vec2 | spawnPos | ) |
Spawn a new Coin.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnCoinAll | ( | C_Vec2 | spawnPos | ) |
Spawn a new CoinAll pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnFlaming | ( | C_Vec2 | spawnPos | ) |
Spawn a new Flaming pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnHealth | ( | C_Vec2 | spawnPos | ) |
Spawn a new Health pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnKillAll | ( | C_Vec2 | spawnPos | ) |
Spawn a new KillAll pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnShield | ( | C_Vec2 | spawnPos | ) |
Spawn a new Shield pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnStormCloud | ( | C_Vec2 | spawnPos | ) |
Spawn a new StormCloud.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnStyphBird | ( | C_Vec2 | spawnPos | ) |
Spawn a new StyphBird.
spawnPos | The position to spawn at. |
void E_EntityManager::spawnTimeSlow | ( | C_Vec2 | spawnPos | ) |
Spawn a new TimeSlow pickup.
spawnPos | The position to spawn at. |
void E_EntityManager::update | ( | float | dt | ) |
A function to update the Entities.
dt | The delta time. |
|
private |
The vector array of Archer Arrows.
|
private |
The vector array of Archers.
|
private |
The arrow shot sound effect.
|
private |
The vector array of coinAll power ups.
|
private |
The coin collect sound effect.
|
private |
The coin all and the kill all collect sound effect.
|
private |
The vector array of Coins.
|
private |
The vector array of particle effects for use with entity death.
|
private |
The enemy death sound effect.
|
private |
The enemy hit sound effect.
|
private |
An unordered map of the entity dimensions.
|
private |
The fire arrow shot sound effect.
|
private |
The fire collect sound effect.
|
private |
The vector array of Flaming Arrows.
|
private |
The vector array of Flaming power ups.
|
private |
The health collect sound effect.
|
private |
The vector array of Health.
|
private |
The vector array of killAll power ups.
|
private |
An unordered map of max tint colours for use with the particle effects.
|
private |
An unordered map of min tint colours for use with the particle effects.
|
private |
A pointer to the Player.
|
private |
The vector array of Player Arrows.
|
private |
A pointer to the renderer.
|
private |
The screen dimensions.
|
private |
The shield collect sound effect.
|
private |
The vector array of shield.
|
private |
The vector array of Storm Clouds.
|
private |
The vector array of StyphBirds.
|
private |
An unordered map of the sprite textures.
|
private |
The time slow collect sound effect.
|
private |
The vector array of TimeSlow power ups.
|
private |
A pointer for the universal speed of the game.