Sdk/Entity: Add DropComponent method
This commit is contained in:
@@ -64,6 +64,15 @@ namespace Ndk
|
||||
* \remark Produces a NazaraAssert if component is not available in this entity
|
||||
*/
|
||||
|
||||
template<typename ComponentType>
|
||||
std::unique_ptr<BaseComponent> Entity::DropComponent()
|
||||
{
|
||||
static_assert(std::is_base_of<BaseComponent, ComponentType>::value, "ComponentType is not a component");
|
||||
|
||||
ComponentIndex index = GetComponentIndex<ComponentType>();
|
||||
return DropComponent(index);
|
||||
}
|
||||
|
||||
template<typename ComponentType>
|
||||
ComponentType& Entity::GetComponent()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user