#pragma once #include #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 { std::shared_ptr world_; std::string name_; std::shared_ptr loc_, rot_, scale_; std::list tags; protected: virtual void OnDestroy(); public: Actor(); Delegate OnSetActorLocate; Delegate OnSetActorRotate; #pragma region ISave std::shared_ptr save() override; 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 Vector3D GetActorLocate() const { return *loc_; } /* * Изменяет ориентацию в пространстве * Вызывает делегат OnSetActorRotate */ void SetActorRotate(const Vector3D& rot) noexcept; inline Vector3D 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; } std::shared_ptr GetWorld() const { return world_; } const std::string& GetName() const { return name_; } friend class World; };