Class for managing entities and their components. More...
#include <Registry.hpp>
Collaboration diagram for ecs::Registry:Classes | |
| class | EntityBuilder |
| class | IPool |
| class | Pool |
Public Member Functions | |
| Registry ()=default | |
| ~Registry ()=default | |
| Registry (const Registry &)=delete | |
| Registry & | operator= (const Registry &)=delete |
| Registry (Registry &&)=delete | |
| Registry & | operator= (Registry &&)=delete |
| EntityBuilder | createEntity () |
| template<typename T , typename... Args> | |
| T & | addComponent (Entity e, Args &&...args) |
| template<typename T > | |
| T * | getComponent (Entity e) |
| template<typename T > | |
| std::unordered_map< Entity, T > & | getAll () |
| template<typename T > | |
| bool | hasComponent (Entity e) |
| template<typename T > | |
| void | removeComponent (Entity e) |
| void | onComponentAdded (std::function< void(Entity, const std::type_info &)> cb) |
Private Member Functions | |
| template<typename T > | |
| Pool< T > & | getPool () |
Private Attributes | |
| Entity | m_lastEntity = INVALID_ENTITY |
| std::vector< Entity > | m_entities |
| std::unordered_map< std::type_index, std::unique_ptr< IPool > > | m_components |
| std::vector< std::function< void(Entity, const std::type_info &)> > | m_onComponentAddedCallbacks |
Class for managing entities and their components.
Definition at line 24 of file Registry.hpp.
|
default |
|
default |
|
delete |
|
delete |
|
inline |
Definition at line 60 of file Registry.hpp.
References getPool(), and m_onComponentAddedCallbacks.
Referenced by ecs::Registry::EntityBuilder::with().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 53 of file Registry.hpp.
References m_entities, and m_lastEntity.
Referenced by ecs::AudioSystem::AudioSystem(), gme::EntityManager::createAdvancedEnemy(), gme::EntityManager::createBasicEnemy(), gme::EntityManager::createBoss(), ecs::StarfieldSystem::createComets(), gme::EntityManager::createEnemyProjectile(), gme::CollisionSystem::createExplosion(), ecs::StarfieldSystem::createNebulae(), gme::Game::createPipePair(), ecs::StarfieldSystem::createPlanets(), gme::EntityManager::createPlayer(), gme::Game::createPlayer(), gme::GameSolo::createPlayer(), gme::PlayerControllerMulti::createPlayer(), gme::EntityManager::createPlayerProjectile(), gme::ProjectileManager::createProjectile(), gme::HUDSystem::createScoreHUD(), ecs::StarfieldSystem::createShootingStars(), ecs::StarfieldSystem::createStars(), ecs::StarfieldSystem::createStarsVaried(), gme::CollisionSystem::ensureEnemyDeathChannel(), gme::CollisionSystem::ensurePlayerDeathAudio(), gme::WeaponSystem::ensureSuperShotAudio(), gme::WeaponSystem::showLoadingAnimation(), gme::SpawnSystem::spawnEnemy(), gme::StageManager::spawnStage(), gme::SpawnSystem::spawnWave(), gme::PlayerControllerMulti::update(), and cli::Client::updateKeyboardInput().
Here is the caller graph for this function:
|
inline |
Definition at line 77 of file Registry.hpp.
References getPool().
Referenced by gme::WeaponSystem::hideLoadingAnimation(), gme::WeaponSystem::showLoadingAnimation(), gme::StageManager::stopScrolling(), ecs::AnimationSystem::update(), ecs::AudioSystem::update(), ecs::BeamSystem::update(), ecs::DebugSystem::update(), ecs::SpriteSystem::update(), ecs::StarfieldSystem::update(), ecs::TextSystem::update(), gme::AnimationSystem::update(), gme::BeamSystem::update(), gme::CollisionSystem::update(), gme::EnemySystem::update(), gme::ExplosionSystem::update(), gme::FlappyDebugSystem::update(), gme::HealthBarSystem::update(), gme::HUDSystem::update(), gme::LoadingAnimationSystem::update(), gme::PlayerControllerMulti::update(), gme::PlayerDirectionSystem::update(), gme::ProjectileSystem::update(), gme::ScrollingSystem::update(), gme::WeaponSystem::update(), and cli::Client::updateKeyboardInput().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 71 of file Registry.hpp.
References getPool().
Referenced by gme::EnemyAISystem::applyAggressiveMovement(), gme::CollisionSystem::applyDamageToEnemy(), gme::CollisionSystem::applyDamageToPlayer(), gme::EnemyAISystem::applySineWaveMovement(), gme::EnemyAISystem::applyZigzagMovement(), ecs::AudioSystem::AudioSystem(), gme::EnemyAISystem::canShoot(), gme::Game::checkCollisions(), gme::Game::checkScore(), gme::EnemyAISystem::clampToScreen(), gme::Game::drawDebugRectangles(), gme::EnemyAISystem::findNearestPlayer(), gme::EntityManager::getAllEntityStates(), gme::CollisionSystem::getCollisionInfo(), gme::EnemyAISystem::getDistanceToNearestPlayer(), gme::CollisionSystem::handleEnemyProjectilePlayerCollision(), gme::CollisionSystem::handlePlayerEnemyCollision(), gme::GameSolo::handlePlayerInputs(), gme::CollisionSystem::handlePlayerProjectileEnemyCollision(), gme::RTypeServer::handlePlayerShooting(), gme::CollisionSystem::playEnemyDeathSound(), gme::CollisionSystem::playPlayerDeathSound(), gme::RTypeServer::processPlayerInputEvent(), gme::WeaponSystem::showLoadingAnimation(), gme::WeaponSystem::tryFireSupercharged(), gme::EnemyAISystem::tryShoot(), ecs::AnimationSystem::update(), ecs::BeamSystem::update(), ecs::DebugSystem::update(), ecs::SpriteSystem::update(), ecs::StarfieldSystem::update(), ecs::TextSystem::update(), gme::AnimationSystem::update(), gme::BeamSystem::update(), gme::CollisionSystem::update(), gme::EnemySystem::update(), gme::ExplosionSystem::update(), gme::FlappyDebugSystem::update(), gme::HealthBarSystem::update(), gme::LoadingAnimationSystem::update(), gme::PlayerControllerMulti::update(), gme::PlayerDirectionSystem::update(), gme::ProjectileSystem::update(), gme::ScrollingSystem::update(), gme::WeaponSystem::update(), gme::EnemyAISystem::updateAdvancedEnemyAI(), gme::EnemyAISystem::updateBasicEnemyAI(), gme::EnemyAISystem::updateBossAI(), gme::RTypeServer::updateEntities(), gme::GameMulti::updateInterpolation(), cli::Client::updateKeyboardInput(), and gme::HUDSystem::updateScore().
Here is the call graph for this function:
|
inlineprivate |
Definition at line 129 of file Registry.hpp.
References m_components.
Referenced by addComponent(), getAll(), getComponent(), hasComponent(), and removeComponent().
Here is the caller graph for this function:
|
inline |
Definition at line 79 of file Registry.hpp.
References getPool().
Referenced by gme::EntityManager::clear(), gme::CollisionSystem::ensureEnemyDeathChannel(), gme::CollisionSystem::ensurePlayerDeathAudio(), gme::WeaponSystem::ensureSuperShotAudio(), gme::WeaponSystem::hideLoadingAnimation(), gme::EntityManager::processDestroyQueue(), gme::CollisionSystem::removeEnemy(), gme::ExplosionSystem::removeExplosion(), gme::CollisionSystem::removeProjectile(), ecs::DebugSystem::update(), ecs::SpriteSystem::update(), gme::EnemySystem::update(), gme::FlappyDebugSystem::update(), gme::ProjectileSystem::update(), and gme::ScrollingSystem::update().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 91 of file Registry.hpp.
References m_onComponentAddedCallbacks.
Referenced by ecs::AudioSystem::AudioSystem().
Here is the caller graph for this function:
|
inline |
Definition at line 85 of file Registry.hpp.
References getPool().
Referenced by gme::EntityManager::clear(), gme::WeaponSystem::hideLoadingAnimation(), gme::EntityManager::processDestroyQueue(), gme::CollisionSystem::removeEnemy(), gme::ExplosionSystem::removeExplosion(), gme::CollisionSystem::removeProjectile(), gme::EnemySystem::update(), and gme::ProjectileSystem::update().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 140 of file Registry.hpp.
Referenced by getPool().
|
private |
Definition at line 139 of file Registry.hpp.
Referenced by createEntity().
|
private |
Definition at line 138 of file Registry.hpp.
Referenced by createEntity().
|
private |
Definition at line 141 of file Registry.hpp.
Referenced by addComponent(), and onComponentAdded().