#pragma once #include #include "RTTI.h" #include "RTTI_Meta.h" #include "Game/SaveMap/ISave.h" #include "Delegate/Delegate.h" #include "Math/Vector.hpp" #include "Types/object_ptr.hpp" class World; GENERATE_META(Actor) class Actor : public ISave, public IRTTI { World* world_; UType::object_ptr loc, rot, scale; std::list tags; protected: virtual void OnDestroy(); public: Actor(); Delegate OnSetActorLocate; Delegate OnSetActorRotate; #pragma region ISave virtual std::shared_ptr save() override; virtual void load(std::shared_ptr save) override; #pragma endregion virtual void BeginPlay(); virtual void Tick(double delta_time); /* * Изменяет положение в пространстве * Вызывает делегат OnSetActorLocate */ void SetActorLocate(const Vector3D& loc) noexcept; inline const UType::object_ptr GetActorLocate() const { return loc; } /* * Изменяет ориентацию в пространстве * Вызывает делегат OnSetActorRotate */ void SetActorRotate(const Vector3D& rot) noexcept; inline const UType::object_ptr GetActorRotate() const { return rot; } void AddTag(const std::string& tag) noexcept; void RemoveTag(const std::string& tag) noexcept; const std::list& GetTags() const { return tags; } void Destroy(); World* GetWorld() const { return world_; } friend class World; };