Move world on unordered_map and object_ptr

This commit is contained in:
Jiga228
2025-10-18 14:26:22 +07:00
parent bed233e56c
commit 0ec86e3de8
8 changed files with 99 additions and 39 deletions
+1 -7
View File
@@ -8,7 +8,7 @@ void Actor::OnDestroy()
{
}
Actor::Actor()
Actor::Actor() : loc(new Vector3D), rot(new Vector3D), scale(new Vector3D)
{
SetType(Classes::Actor);
}
@@ -60,9 +60,3 @@ void Actor::RemoveTag(const std::string& tag) noexcept
{
tags.remove(tag);
}
void Actor::Destroy()
{
OnDestroy();
//world_->actors.remove(this);
}
+2 -1
View File
@@ -15,6 +15,7 @@ GENERATE_META(Actor)
class Actor : public ISave, public IRTTI
{
World* world_;
std::string name_;
UType::object_ptr<Vector3D> loc, rot, scale;
@@ -53,9 +54,9 @@ public:
void AddTag(const std::string& tag) noexcept;
void RemoveTag(const std::string& tag) noexcept;
const std::list<std::string>& GetTags() const { return tags; }
void Destroy();
World* GetWorld() const { return world_; }
const std::string& GetName() const { return name_; }
friend class World;
};