Fixed a few small things.

This commit is contained in:
2023-06-20 09:29:16 -07:00
parent 0b26b5a06a
commit 0b3bae6e6c
8 changed files with 89 additions and 11 deletions

View File

@ -10,18 +10,18 @@ namespace Dawn {
template<typename T>
class VNSetEvent : public VNAnimateEvent<T> {
public:
T *modifies = nullptr;
StateProperty<T> *modifies = nullptr;
protected:
void onStart() override {
assertNotNull(this->modifies);
this->from = *modifies;
this->from = modifies->getValue();
VNAnimateEvent<T>::onStart();
}
void setValue(T value) override {
*modifies = value;
modifies->setValue(value);
}
};
}

View File

@ -110,6 +110,26 @@ namespace Dawn {
return this->_realValue;
}
/**
* Provides an alternate way to set the value, e.g. if using the equals
* operator is not possible.
*
* @param val Value to set on this property.
*/
void setValue(V val) {
this->setInternal(val);
}
/**
* Provides an alternate way to get the value, e.g. if using the equals
* operator is not possible.
*
* @return The value of this property.
*/
V getValue() {
return this->_realValue;
}
/**
* Destructor for StateProperty.
*/