Move to object_ptr
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user