1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
use crate::Bone;

/// The transformation for a bone at a particular time
#[derive(Debug, PartialEq, Serialize, Deserialize, Copy, Clone)]
pub struct BoneKeyframe {
    frame: u16,
    bone: Bone,
}

#[allow(missing_docs)]
impl BoneKeyframe {
    pub fn new(frame: u16, bone: Bone) -> Self {
        BoneKeyframe { frame, bone }
    }

    pub fn frame(&self) -> u16 {
        self.frame
    }

    pub fn bone(&self) -> Bone {
        self.bone
    }

    pub fn bone_mut(&mut self) -> &mut Bone {
        &mut self.bone
    }

    pub fn set_bone(&mut self, bone: Bone) {
        self.bone = bone;
    }
}