numples 1.2.0

Yet another colourful sudoku playing game.
Documentation
use bevy::prelude::*;

use super::tween::Tween;

pub fn tween_events(
    mut commands: Commands,
    mut query: Query<(Entity, &mut Tween, &mut Transform)>,
    time: Res<Time>,
) {
    let dt = time.delta().as_secs_f32();
    for (entity, mut tween, transform) in &mut query {
        match tween.clone() {
            Tween::Delete(..) => {
                if tween.update(dt).remove_entity() {
                    commands.entity(entity).despawn();
                }
            }
            Tween::Value { .. } => {
                let finished = tween.update(dt);
                tween.apply(transform.into_inner());
                if finished.remove_entity() {
                    commands.entity(entity).despawn();
                } else if finished.remove_component() {
                    commands.entity(entity).remove::<Tween>();
                }
            }
        }
    }
}