use crate::color::Color;
#[derive(Debug)]
pub struct Animation {
slots: Vec<SlotAnimation>,
bones: Vec<BoneAnimation>,
}
#[derive(Debug)]
pub struct SlotAnimation {
slot: usize,
timelines: Vec<AnimationTimeline>,
}
#[derive(Debug)]
pub struct AnimationTimeline {
timeline_type: AnimationTimelineType,
}
#[derive(Debug)]
pub enum AnimationTimelineType {
Attachment(Vec<AttachmentKeyframe>),
Color(Vec<ColorKeyframe>),
TwoColor(Vec<TwoColorKeyframe>),
}
#[derive(Debug)]
pub struct AttachmentKeyframe {
time: f32,
attachment_string: Option<usize>,
}
#[derive(Debug)]
pub struct ColorKeyframe {
time: f32,
color: Color,
curve: Option<Curve>,
}
#[derive(Debug)]
pub struct TwoColorKeyframe {
time: f32,
light: Color,
dark: Color,
curve: Option<Curve>,
}
#[derive(Debug)]
pub struct BoneAnimation {
bone: usize,
timelines: Vec<AnimationTimeline>,
}
#[derive(Debug)]
pub struct Curve {
curve_type: CurveType,
parameters: Vec<f32>,
}
#[derive(Debug)]
pub enum CurveType {
Linear,
Stepped,
Bezier(BezierCurve),
}
#[derive(Debug)]
pub struct BezierCurve {
cx1: f32,
cy1: f32,
cx2: f32,
cy2: f32,
}