module;

module Crafter.Component;

using namespace Crafter;

Component::Component() {

}

Component::~Component() {
    onDelete.Invoke();
}

void Component::AddOwner()
{
    refCount++;
}

void Component::RemoveOwner()
{
    refCount--;
    if (refCount == 0) {
        delete this;
    }
}
