Simple C++ Game
|
An EntityFamily that defines a class as having a component of each of the specified types. More...
#include <ComponentFamily.hpp>
Public Member Functions | |
ComponentFamily () | |
Construct a default new Component Family object. More... | |
ComponentFamily (const std::unordered_set< std::string > componentIds) | |
Construct a new Component Family object. More... | |
bool | isInFamily (const Entity &entity) const |
Checks if the entity has all of the required componets to fit the family. More... | |
An EntityFamily that defines a class as having a component of each of the specified types.
ComponentFamily::ComponentFamily | ( | ) |
Construct a default new Component Family object.
The default constructor doesn't require any specific families, so all entities will be considered 'in the family'.
ComponentFamily::ComponentFamily | ( | const std::unordered_set< std::string > | componentIds | ) |
Construct a new Component Family object.
Constructs a ComponentFamily that accepts all entities that have a component for each of the provided IDs.
componentIds | The IDs of the required component classes. These are idiomatically implemented as const static std::string members of the Component's class. |
|
virtual |
Checks if the entity has all of the required componets to fit the family.
entity | The entity to evaluate if it is has all the components to be in the family. |
Implements EntityFamily.