Esempio n. 1
0
 void Entity::AddComponent(const Foundation::ComponentInterfacePtr &component)
 {
     // Must exist and be free
     if (component && component->GetParentEntity() == 0)
     {
         component->SetParentEntity(this);
         components_.push_back(component);
     
         ///\todo Ali: send event
     }
 }
Esempio n. 2
0
 void Entity::AddComponent(const Foundation::ComponentInterfacePtr &component, AttributeChange::Type change)
 {
     // Must exist and be free
     if (component && component->GetParentEntity() == 0)
     {
         component->SetParentEntity(this);
         components_.push_back(component);
     
         if (scene_)
             scene_->EmitComponentAdded(this, component.get(), change);
     }
 }