1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
use super::sprite::texel::part::Part;
use super::emotion::Emotion;

#[repr(C)]
#[derive(Copy, Clone, Debug, Default, Eq, PartialEq, Hash)]
pub struct Tuple {
    pub part: Part,
    pub emotion: Emotion,
}

impl From<(Part, Emotion)> for Tuple {

    /// The constructor `from` returns a tuple of Part and Emotion
    /// according to the argumentation.
    fn from((part, emotion): (Part, Emotion)) -> Self {
        Tuple {
            part: part,
            emotion: emotion,
        }
    }
}