Last commit before the massive state refactor.

This commit is contained in:
2023-02-27 09:19:14 -08:00
parent 0ae51cd4dd
commit e625078efe
4 changed files with 20 additions and 4 deletions

View File

@ -59,7 +59,7 @@ namespace Dawn {
* @param o The old, previous value of the property.
*/
template<class V>
void onStatePropertyUpdated(StateProperty<V> *prop, V n, V o) {
void _statePropertyUpdated(StateProperty<V> *prop, V n, V o) {
this->onStateUpdate();
auto eff = &this->effects[prop];
@ -69,5 +69,17 @@ namespace Dawn {
++itEff;
}
}
/**
* Internal method to listen for when a state property is disposed or
* destroyed so that it can be completely removed from this state owner.
*
* @tparam V Value type.
* @param prop Property that was destroyed.
*/
template<class V>
void _statePropertyDestroyed(StateProperty<V> *prop) {
this->effects.erase((void*)prop);
}
};
}