This function is used to remove a component from an entity.
dg_component_t *dg_entity_rm_component(dg_entity_t *entity, char *name);
int score = dg_entity_rm_component(entity, "score");
dg_component_t *dg_entity_rm_component(dg_entity_t *entity, char *name)
{
int comp = -1;
if (!entity || name)
return 0;
comp = dg_entity_has_component(entity, name);
if (comp == -1)
return 0;
return dg_arr_remove_at(&(entity->components), comp);
}