Atlas
A Convenient Entity Component System
 All Classes Namespaces Files Functions Variables Typedefs Friends
Atlas::SystemManager Class Reference

A manager for all Systems that are used. More...

#include <SystemManager.h>

Inheritance diagram for Atlas::SystemManager:
Collaboration diagram for Atlas::SystemManager:

Public Member Functions

 SystemManager (World &world)
 Creates a new SystemManager. More...
 
void addSystem (System::Ptr system)
 Adds a new System. More...
 
template<typename T >
T * getSystem ()
 Retrieves a specified System. More...
 
void update (float dt)
 Updates all Systems. More...
 
void checkInterest (Entity &entity)
 Checks to see if the any Systems contained in the SystemManager is interested in an Entity based on which Components it owns. More...
 
template<typename T >
void removeSystem ()
 Removes a System. More...
 
void toString ()
 Prints the number of active Systems and the details of each of those Systems. More...
 
- Public Member Functions inherited from Atlas::NonCopyable
 NonCopyable ()=default
 Default Constructor. More...
 
virtual ~NonCopyable ()
 

Detailed Description

A manager for all Systems that are used.

Constructor & Destructor Documentation

Atlas::SystemManager::SystemManager ( World world)

Creates a new SystemManager.

Parameters
world- the World object that owns this SystemManager

Member Function Documentation

void Atlas::SystemManager::addSystem ( System::Ptr  system)

Adds a new System.

Usage Example:

SystemManager.addSystem(Atlas::System::Ptr(new HealthSystem(world)));
Parameters
system- the System to be added.
void Atlas::SystemManager::checkInterest ( Entity entity)

Checks to see if the any Systems contained in the SystemManager is interested in an Entity based on which Components it owns.

Parameters
entity- the Entity to be checked
template<typename T >
T* Atlas::SystemManager::getSystem ( )
inline

Retrieves a specified System.

Usage Example:

HealthSystem* system = SystemManager.getSystem<HealthSystem>();
Returns
pointer to the System.
template<typename T >
void Atlas::SystemManager::removeSystem ( )

Removes a System.

Usage Example:

systemManager.removeSystem<HealthSystem>();
void Atlas::SystemManager::toString ( )

Prints the number of active Systems and the details of each of those Systems.

void Atlas::SystemManager::update ( float  dt)

Updates all Systems.

Update order is based on the order that Systems are added to the SystemManager.

Parameters
dt- update time

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