GameObjectPool

This commit is contained in:
2024-09-13 22:58:31 +05:00
parent bff2182ff0
commit 3df4361779
12 changed files with 306 additions and 20 deletions

29
src/Game/GameObject.cpp Normal file
View File

@@ -0,0 +1,29 @@
#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::operator=(GameObject &&o){
transform = o.transform;
components = std::move(o.components);
object_handle = std::move(o.object_handle);
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;
}