3 #include "engine/entity_manager.h"
4 #include "engine/component_collection.h"
7 #include <forward_list>
10 #include <unordered_map>
21 template<
typename ComponentType>
26 template<
typename ComponentType>
27 struct ExtractComponentType {
29 using PointerType = ComponentType*;
31 using Type = ComponentType;
35 template<
typename ComponentType>
36 struct ExtractComponentType<Optional<ComponentType>> {
38 using PointerType = ComponentType*;
40 using Type = ComponentType;
96 template<
typename... ComponentTypes>
108 typename detail::ExtractComponentType<ComponentTypes>::PointerType...
114 using EntityMap = std::unordered_map<EntityId, ComponentGroup>;
130 bool recordChanges =
false
158 typename EntityMap::const_iterator
191 typename EntityMap::const_iterator
211 std::unordered_set<EntityId>&
236 struct Implementation;
237 std::unique_ptr<Implementation> m_impl;
246 #include "engine/entity_filter.cpp"
EntityMap::const_iterator begin() const
Iterator.
Definition: entity_filter.cpp:248
EntityFilter(bool recordChanges=false)
Constructor.
Definition: entity_filter.cpp:231
std::unordered_map< EntityId, ComponentGroup > EntityMap
Typedef for the filter's list of relevant entities.
Definition: entity_filter.h:114
Marker for optional components in a filter.
Definition: entity_filter.h:22
Manages entities and their components.
Definition: entity_manager.h:23
Filters for entities that contain specific components.
Definition: entity_filter.h:97
~EntityFilter()
Destructor.
Definition: entity_filter.h:136
void setEntityManager(EntityManager *entityManager)
Sets the entity manager this filter applies to.
Definition: entity_filter.cpp:299
Definition: bullet_ogre_conversion.h:6
EntityMap::const_iterator end() const
Iterator.
Definition: entity_filter.cpp:272
EntityMap & addedEntities()
Returns the entities added to this filter.
Definition: entity_filter.cpp:240
bool containsEntity(EntityId id) const
Checks whether an entity id is contained in this filter.
Definition: entity_filter.cpp:263
void clearChanges()
Clears the lists for added and removed entities.
Definition: entity_filter.cpp:255
const EntityMap & entities() const
The relevant entities.
Definition: entity_filter.cpp:279
std::tuple< typename detail::ExtractComponentType< ComponentTypes >::PointerType... > ComponentGroup
Typedef for the filter's component tuple.
Definition: entity_filter.h:109
std::unordered_set< EntityId > & removedEntities()
Returns the entities removed from this filter.
Definition: entity_filter.cpp:286
EntityManager * entityManager()
Gets the current entiyManager.
Definition: entity_filter.cpp:293