10 Entity::Entity(Handle<Entity> p, TransformTag):
14 Entity::Entity(Handle<Entity> p, const TransformValues &tv):
18 transform->set_values(tv);
21 // Hide ~Owned<Transform> from the header
25 void Entity::add_component(Handle<Component> comp)
27 if(comp->get_entity().get()!=this)
28 throw hierarchy_error();
30 components.push_back(comp);
33 void Entity::remove_component(Handle<Component> comp)
35 erase(components, comp);
38 void Entity::add_child(Handle<Entity> child)
40 if(child->get_parent().get()!=this)
41 throw hierarchy_error();
43 children.push_back(child);
46 void Entity::remove_child(Handle<Entity> child)
48 erase(children, child);
51 Stage &Entity::get_stage()
53 Handle<Entity> root = get_root();
54 return dynamic_cast<Root &>(*root).get_stage();
57 } // namespace Msp::Game