#include "entity.h"
#include "component.h"
-#include "stage.h"
+#include "root.h"
+#include "transform.h"
using namespace std;
namespace Msp::Game {
-Entity::Entity(Handle<Entity> p):
+Entity::Entity(Handle<Entity> p, TransformTag):
parent(p)
{ }
+Entity::Entity(Handle<Entity> p, const TransformValues &tv):
+ parent(p),
+ transform(*this)
+{
+ transform->set_values(tv);
+}
+
+// Hide ~Owned<Transform> from the header
+Entity::~Entity()
+{ }
+
void Entity::add_component(Handle<Component> comp)
{
if(comp->get_entity().get()!=this)
erase(children, child);
}
+Stage &Entity::get_stage()
+{
+ Handle<Entity> root = get_root();
+ return dynamic_cast<Root &>(*root).get_stage();
+}
+
} // namespace Msp::Game