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
+62
View File
@@ -0,0 +1,62 @@
#pragma once
#include <list>
#include "RTTI.h"
#include "RTTI_Meta.h"
#include "Game/SaveMap/ISave.h"
#include "Delegate/Delegate.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();
Delegate<const Vector3D&> OnSetActorLocate;
Delegate<const Vector3D&> OnSetActorRotate;
#pragma region ISave
virtual std::shared_ptr<SaveMap> save() override;
virtual void load(std::shared_ptr<SaveMap> save) override;
#pragma endregion
virtual void BeginPlay();
virtual void Tick(double delta_time);
/*
* Изменяет положение в пространстве
* Вызывает делегат OnSetActorLocate
*/
void SetActorLocate(const Vector3D& loc) noexcept;
inline const Vector3D& GetActorLocate() const { return loc; }
/*
* Изменяет ориентацию в пространстве
* Вызывает делегат OnSetActorRotate
*/
void SetActorRotate(const Vector3D& rot) noexcept;
inline const Vector3D& GetActorRotate() const { return rot; }
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;
};