#include "Actor.h" #include "Game/SaveMap/SaveMap.h" #include "Log/Log.h" Actor::Actor() { SetType(Classes::Actor); } std::shared_ptr Actor::save() noexcept { std::shared_ptr save = std::make_shared("Actor"); save->SaveObject("loc", &loc) ->SaveObject("rot", &rot) ->SaveObject("scale", &scale) ->SaveListStrings("tags", std::move(tags)); return save; } void Actor::load(std::shared_ptr save) noexcept { loc = *reinterpret_cast(save->GetObject("loc")); rot = *reinterpret_cast(save->GetObject("rot")); scale = *reinterpret_cast(save->GetObject("scale")); tags = std::move(save->GetListString("tags")); } void Actor::BeginPlay() { Log("Actor::BeginPlay"); } void Actor::Tick(double delta_time) { } void Actor::SetActorLocate(const Vector3D& loc) noexcept { this->loc = loc; OnSetActorLocate.Call(loc); } void Actor::SetActorRotate(const Vector3D& rot) noexcept { this->rot = rot; OnSetActorRotate.Call(rot); } void Actor::AddTag(const std::string& tag) noexcept { tags.push_back(tag); } void Actor::RemoveTag(const std::string& tag) noexcept { tags.remove(tag); }