Add GetWorld to Actor. Integrate google test. Add Model manager class. Rename *.h to *.hpp files
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
#include "World.h"
|
||||
#include "World.hpp"
|
||||
|
||||
#include "Game/SaveMap/SaveMap.h"
|
||||
#include "Game/SaveMap/SaveMap.hpp"
|
||||
|
||||
World::World(GameInstance& game_instance) : game_instance(game_instance)
|
||||
{
|
||||
@@ -35,4 +35,7 @@ std::shared_ptr<SaveMap> World::save()
|
||||
void World::load(std::shared_ptr<SaveMap> save)
|
||||
{
|
||||
actors = std::move(reinterpret_cast<std::list<Actor*>&>(save->GetListObject("Actors")));
|
||||
|
||||
for (auto& i : actors)
|
||||
i->world_ = this;
|
||||
}
|
||||
@@ -5,11 +5,12 @@
|
||||
#include <string>
|
||||
|
||||
#include "RTTI.h"
|
||||
#include "Game/Actors/Actor.h"
|
||||
#include "Game/Actors/Actor.hpp"
|
||||
#include "Game/Actors/Mesh/Mesh.hpp"
|
||||
|
||||
class GameInstance;
|
||||
|
||||
GENERATE_META(World);
|
||||
class World : public ISave
|
||||
{
|
||||
GameInstance& game_instance;
|
||||
@@ -49,6 +50,7 @@ public:
|
||||
T* object = new T();
|
||||
object->SetActorLocate(loc);
|
||||
object->SetActorRotate(rot);
|
||||
static_cast<Actor*>(object)->world_ = this;
|
||||
actors.push_back(object);
|
||||
return object;
|
||||
}
|
||||
Reference in New Issue
Block a user