|
@@ -79,7 +79,7 @@ public:
|
|
|
|
|
|
void addEntity(Entity entity);
|
|
|
void removeEntity(Entity entity);
|
|
|
- std::vector<Entity> getEntities() const;
|
|
|
+ std::vector<Entity> getSystemEntities() const;
|
|
|
const Signature& getComponentSignature() const;
|
|
|
|
|
|
template<typename T> void requireComponent();
|
|
@@ -125,7 +125,7 @@ public:
|
|
|
template<typename T> T& getSystem() const;
|
|
|
|
|
|
/* Others */
|
|
|
- void Update();
|
|
|
+ void update();
|
|
|
};
|
|
|
|
|
|
template<typename T, typename ...TArgs> void Registry::addComponent(Entity entity, TArgs&& ...args)
|
|
@@ -184,7 +184,7 @@ template <typename T> T& Registry::getComponent(Entity entity)
|
|
|
const auto entityId = entity.getId();
|
|
|
|
|
|
auto componentPool = std::static_pointer_cast<Pool<T>>(this->componentPools[componentId]);
|
|
|
- return componentPool.get(entityId);
|
|
|
+ return componentPool->get(entityId);
|
|
|
}
|
|
|
|
|
|
template<typename T, typename ...TArgs> void Registry::addSystem(TArgs&& ...args)
|
|
@@ -224,7 +224,7 @@ template <typename T> bool Entity::hasComponent()
|
|
|
}
|
|
|
template <typename T> T& Entity::getComponent()
|
|
|
{
|
|
|
- this->registry->getComponent<T>(*this);
|
|
|
+ return this->registry->getComponent<T>(*this);
|
|
|
}
|
|
|
|
|
|
#endif /* GAMEENGINE_ECS_H */
|