Point lights
This commit is contained in:
@@ -19,12 +19,14 @@ class HydraComponentManager :public HydraObject
|
||||
std::shared_ptr<HydraComponentArray<T>> _GetComponentArray()
|
||||
{
|
||||
std::string type_name = std::string(typeid(T).name());
|
||||
|
||||
if(m_component_types.find(type_name) == m_component_types.end())
|
||||
{
|
||||
std::cout << "Error";
|
||||
}
|
||||
assert(m_component_types.find(type_name) != m_component_types.end() && "Component type does not exist");
|
||||
return std::static_pointer_cast<HydraComponentArray<T>>(m_component_arrays[type_name]);
|
||||
}
|
||||
public:
|
||||
|
||||
template<typename T>
|
||||
ComponentTypeID RegisterComponentType()
|
||||
{
|
||||
@@ -58,7 +60,13 @@ class HydraComponentManager :public HydraObject
|
||||
{
|
||||
return _GetComponentArray<T>()->GetComponent(entity_id);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
T const * const GetComponents()
|
||||
{
|
||||
return _GetComponentArray<T>()->GetComponents();
|
||||
}
|
||||
|
||||
|
||||
template<typename T>
|
||||
bool HasComponent(HydraID entity_id)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user