// Copyright (c) 2023 Dominic Masters // // This software is released under the MIT License. // https://opensource.org/licenses/MIT #include "SimpleComponent.hpp" using namespace Dawn; void SimpleComponent::onInit() { this->initMethod(*this, events); } void SimpleComponent::onDispose() { for(auto &event : events) { event(); } } std::shared_ptr Dawn::addSimpleComponent( std::shared_ptr item, std::function>&)> init ) { auto cmp = item->addComponent(); cmp->initMethod = init; return cmp; }