39 lines
999 B
C++
39 lines
999 B
C++
#include "GameObject.hpp"
|
|
|
|
std::ostream& operator<<(std::ostream& s, Transform& t){
|
|
s<<"{ position: {x: "<<t.position.x<<", y: "<<t.position.y;
|
|
s<<"}, rotation: "<<t.rotation;
|
|
s<<", scale {x: "<<t.scale.x<<", y: "<<t.scale.y<<"} }";
|
|
return s;
|
|
}
|
|
|
|
GameObject::GameObject(Mono::Object managed_obj, GameObject *parent)
|
|
: object_handle(managed_obj), parent(parent)
|
|
{}
|
|
|
|
GameObject::GameObject(GameObject &&o) :
|
|
transform(o.transform),
|
|
components(std::move(o.components)),
|
|
object_handle(std::move(o.object_handle)),
|
|
parent(o.parent)
|
|
{
|
|
}
|
|
|
|
GameObject &GameObject::operator=(GameObject &&o){
|
|
transform = o.transform;
|
|
components = std::move(o.components);
|
|
object_handle = std::move(o.object_handle);
|
|
parent = o.parent;
|
|
return *this;
|
|
}
|
|
|
|
bool GameObject::tryGetComponent(const std::u16string &name, Component **out_component)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
bool GameObject::tryAddComponent(const std::u16string &name, Component &&component)
|
|
{
|
|
return false;
|
|
}
|