Switching SceneItems to smarts

This commit is contained in:
2023-11-12 23:02:11 -06:00
parent 91a91a5404
commit 54da3733d7
124 changed files with 188 additions and 216 deletions

View File

@ -0,0 +1,31 @@
// Copyright (c) 2023 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "SimpleAnimation.hpp"
namespace Dawn {
template<typename T>
struct SimplerCallbackAnimation : public SimpleAnimation<T> {
protected:
T value;
void onValueModified() override {
SimpleAnimation<T>::onValueModified();
this->callback(this->value);
}
public:
std::function<void(T)> callback = std::function<void(T)>();
/**
* Construct a new Simple Function Animation object
*/
SimplerCallbackAnimation() :
SimpleAnimation<T>(&value)
{
}
};
}