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,38 @@
// Copyright (c) 2022 Dominic Masters
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
#pragma once
#include "state/StateEvent.hpp"
namespace Dawn {
struct Animation {
public:
bool_t loop = false;
bool_t finished = false;
float_t time = 0;
float_t duration = 0;
StateEvent<> eventAnimationEnd;
/**
* Ticks the animation along. Delta is whatever you want to update the
* animation by (in seconds). Animations can overshoot if necessary and
* will not be clamped (by default). Subclasses may interpret ticks in
* different ways.
*
* @param delta Time delta (in seconds) to tick the animaiton by.
*/
virtual void tick(const float_t delta) = 0;
/**
* Restart a running animation.
*/
virtual void restart();
/**
* Clears an animaton of all its animation items and keyframes.
*/
virtual void clear();
};
}