#include <object/components/component.hpp>

namespace Game::Object::Components {
    Component::~Component() = default;

    Component::Component(const Component& other) : mName(other.mName), mIsActive(other.mIsActive) {
        LOG("Copied Component: " << mName);
    }

    Component& Component::operator=(const Component& other) {
        if (this != &other) {
            mName = other.mName;
            mIsActive = other.mIsActive;
        }
        return *this;
    }

    Component::Component(Component&& other) noexcept : mName(std::move(other.mName)), mIsActive(other.mIsActive) {
        LOG("Moved Component: " << mName);
    }

    Component& Component::operator=(Component&& other) noexcept {
        if (this != &other) {
            mName = std::move(other.mName);
            mIsActive = other.mIsActive;
        }
        return *this;
    }

    void Component::setName(const std::string& name) {
        mName = name;
    }

    std::string Component::getName() {
        return mName;
    }

    void Component::setActive(bool active) {
        mIsActive = active;
    }

    bool Component::isActive() {
        return mIsActive;
    }
}