Move to object_ptr

This commit is contained in:
Jiga228
2025-10-17 21:39:30 +07:00
parent 136235749a
commit 137522cefa
8 changed files with 58 additions and 48 deletions
+3 -2
View File
@@ -7,6 +7,7 @@
#include "RTTI.h"
#include "Game/Actors/Actor.hpp"
#include "Game/Actors/Mesh/Mesh.hpp"
#include "Types/object_ptr.hpp"
class GameInstance;
@@ -16,7 +17,7 @@ class World : public ISave
GameInstance& game_instance;
// Actors only
std::list<Actor*> actors;
std::list<UType::object_ptr<Actor>> actors;
public:
World(GameInstance& game_instance);
@@ -38,7 +39,7 @@ public:
Container list;
for (auto i = actors.cbegin(); i != actors.cend(); ++i)
{
if (T* cast_object = RTTI::dyn_cast<T>(*i))
if (T* cast_object = RTTI::dyn_cast<T, Actor>((*i).get()))
list.push_back(cast_object);
}
return list;