9 Entity::Entity(Handle<Entity> p):
13 void Entity::add_component(Handle<Component> comp)
15 if(comp->get_entity().get()!=this)
16 throw hierarchy_error();
18 components.push_back(comp);
21 void Entity::remove_component(Handle<Component> comp)
23 erase(components, comp);
26 void Entity::add_child(Handle<Entity> child)
28 if(child->get_parent().get()!=this)
29 throw hierarchy_error();
31 children.push_back(child);
34 void Entity::remove_child(Handle<Entity> child)
36 erase(children, child);
39 Stage &Entity::get_stage()
41 Handle<Entity> root = get_root();
42 return dynamic_cast<Root &>(*root).get_stage();
45 } // namespace Msp::Game