#include "Actor.h" #include "EngineFrame/Scene/Scene.h" #include Actor::Actor() { } Actor::~Actor() { } void Actor::Init() { } void Actor::HandleEvents(SDL_Event *e) { } void Actor::Update(float deltaTime) { Actor_base::Update(deltaTime); RefPtr child = m_Components.GetFirst(); while (child) { if (child->hasTag(Tag::UPDATE)) child->Update(deltaTime); if (child->hasTag(Tag::RENDER)) { } child = child->GetNext(); } } void Actor::Render(float deltaTime) { Actor_base::Render(deltaTime); RefPtr child = m_Components.GetFirst(); while (child) { if (child->hasTag(Tag::RENDER)) child->Render(deltaTime); child = child->GetNext(); } } void Actor::Clear() { } void Actor::AddComponent(RefPtr Component) { m_Components.PushBack(Component); Component->OnAdded(this); Component->ReorderComponents(); } void Actor::RemoveComponent(RefPtr Component) { Component->Parent = nullptr; m_Components.Remove(Component); } void Actor::SetPos(SDL_Point pos) { this->Pos = pos; } SDL_Point Actor::GetPos() { return this->Pos; }