Basic movement example

This commit is contained in:
2024-09-11 08:21:26 -05:00
parent 916396e175
commit 01c56477aa
9 changed files with 85 additions and 15 deletions

View File

@ -39,6 +39,11 @@ void SceneComponent::dispose() {
sceneComponentState,
SCENE_COMPONENT_STATE_DISPOSED
);
// Clear Listeners
for(auto &listener : this->listeners) listener();
this->listeners.clear();
this->onDispose();
this->item.reset();
}

View File

@ -21,6 +21,8 @@ namespace Dawn {
uint_fast8_t sceneComponentState = 0;
protected:
std::vector<std::function<void()>> listeners;
/**
* Custom component listener that is invoked when the component is meant
* to initialize.