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

Base class for all Systems. More...

#include <System.h>

Inheritance diagram for Atlas::System:
Collaboration diagram for Atlas::System:

Public Types

typedef std::unique_ptr< SystemPtr
 Standard pointer when referring to a System. More...
 

Public Member Functions

 System (World &world)
 Creates a new System. More...
 
virtual ~System ()
 
virtual void update (float dt)=0
 Proccesses all Entities relevant to this System. More...
 
virtual void checkInterest (Entity &Entity)
 Checks to see if the System is interested in an Entity based on which Components it owns. More...
 
std::bitset< BITSIZEgetSystemBits () const
 Retrieves the system type bits that are assigned to this System. More...
 
void toString ()
 Prints Entities in the System, as well as this System's TypeBits and SystemBits. More...
 
- Public Member Functions inherited from Atlas::NonCopyable
 NonCopyable ()=default
 Default Constructor. More...
 
virtual ~NonCopyable ()
 

Protected Member Functions

template<typename T >
void addComponentType ()
 Adds a Component type for the System to process. More...
 
std::bitset< BITSIZEgetTypeBits () const
 Retrieves the Component bit types that the System will process. More...
 
const std::vector< Entity::ID > & getEntities () const
 Retrieves the Entity::IDs of interested Entities. More...
 
WorldgetWorld () const
 Retrieves the World object for this System. More...
 

Friends

class SystemManager
 

Detailed Description

Base class for all Systems.

Member Typedef Documentation

typedef std::unique_ptr<System> Atlas::System::Ptr

Standard pointer when referring to a System.

Constructor & Destructor Documentation

Atlas::System::System ( World world)

Creates a new System.

Parameters
world- the World object that owns this System
virtual Atlas::System::~System ( )
virtual

Member Function Documentation

template<typename T >
void Atlas::System::addComponentType ( )
inlineprotected

Adds a Component type for the System to process.

Usage Example: (in HealthSystem constructor)

addComponentType<HealthComponent>();
virtual void Atlas::System::checkInterest ( Entity Entity)
virtual

Checks to see if the System is interested in an Entity based on which Components it owns.

This is called everytime an Entity removes or adds a Component. If the System is no longer interested in an Entity that it already contains, the Entity will be removed from the System.

Parameters
Entity- the Entity to be checked
const std::vector<Entity::ID>& Atlas::System::getEntities ( ) const
protected

Retrieves the Entity::IDs of interested Entities.

Returns
Container of Entity::IDs
std::bitset<BITSIZE> Atlas::System::getSystemBits ( ) const

Retrieves the system type bits that are assigned to this System.

Returns
Bitset assigned to this System
std::bitset<BITSIZE> Atlas::System::getTypeBits ( ) const
protected

Retrieves the Component bit types that the System will process.

Returns
Bitset of Component types
World& Atlas::System::getWorld ( ) const
protected

Retrieves the World object for this System.

void Atlas::System::toString ( )

Prints Entities in the System, as well as this System's TypeBits and SystemBits.

virtual void Atlas::System::update ( float  dt)
pure virtual

Proccesses all Entities relevant to this System.

Parameters
dt- update time

Friends And Related Function Documentation

friend class SystemManager
friend

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