tuigui 0.23.0

An easy-to-use, highly extensible, and speedy TUI library.
Documentation
use crate::preludes::animation_creation::*;

/// Useful for when you need many different animations in a single
/// sequence or a list of same-type animations
pub struct AnimationDyn {
    pub animation: Box<dyn Animation>,
}

impl AnimationDyn {
    pub fn new(animation: Box<dyn Animation>) -> Self {
        Self {
            animation,
        }
    }
}

impl Animation for AnimationDyn {
    fn animated_transform(&mut self, original_transform: Transform, duration_seconds: f64) -> Transform {
        return self.animation.animated_transform(original_transform, duration_seconds);
    }

    fn is_done(&self, duration_seconds: f64) -> bool {
        return self.animation.is_done(duration_seconds);
    }
}