Add GetWorld to Actor. Integrate google test. Add Model manager class. Rename *.h to *.hpp files

This commit is contained in:
Jiga228
2025-10-13 19:31:27 +07:00
parent fedffa7634
commit 8819114b63
44 changed files with 424 additions and 59 deletions
+14 -3
View File
@@ -1,7 +1,12 @@
#include "Actor.h"
#include "Actor.hpp"
#include "Game/SaveMap/SaveMap.h"
#include "Log/Log.h"
#include "Game/SaveMap/SaveMap.hpp"
#include "Game/World/World.hpp"
#include "Log/Log.hpp"
void Actor::OnDestroy()
{
}
Actor::Actor()
{
@@ -55,3 +60,9 @@ void Actor::RemoveTag(const std::string& tag) noexcept
{
tags.remove(tag);
}
void Actor::Destroy()
{
OnDestroy();
//world_->actors.remove(this);
}
@@ -6,16 +6,23 @@
#include "RTTI_Meta.h"
#include "Game/SaveMap/ISave.h"
#include "Delegate/Delegate.h"
#include "Math/Vector.h"
#include "Math/Vector.hpp"
class World;
GENERATE_META(Actor)
class Actor : public ISave, public IRTTI
{
World* world_;
Vector3D loc;
Vector3D rot;
Vector3D scale;
std::list<std::string> tags;
protected:
virtual void OnDestroy();
public:
Actor();
@@ -47,4 +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_; }
friend class World;
};
+1 -1
View File
@@ -1,6 +1,6 @@
#include "Mesh.hpp"
#include "Game/SaveMap/SaveMap.h"
#include "Game/SaveMap/SaveMap.hpp"
Mesh::Mesh()
{
+1 -1
View File
@@ -2,7 +2,7 @@
#include <string>
#include "../Actor.h"
#include "../Actor.hpp"
GENERATE_META(Mesh)
class Mesh : public Actor