use serde::{Serialize, Deserialize};
use bincode::{serialize, deserialize};
#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub struct Bloke {
pub version: u16,
pub height_arch: u16,
pub height_leg: u16,
pub height_body: u16,
pub height_neck: u16,
pub height_head: u16,
pub height_hair: u16,
pub length_foot: u16,
pub length_toes: u16,
pub size_legs: u16,
pub size_knee: u16,
pub size_calf: u16,
pub size_hamstring: u16,
pub size_butt: u16,
pub size_body: u16,
pub size_belly: u16,
pub size_chest: u16,
pub size_spine: u16,
pub size_hunch: u16,
pub size_shoulder: u16,
pub size_arm_muscle: u16,
pub size_arm_fat: u16,
pub size_elbow: u16,
pub size_hand: u16,
pub size_finger: u16,
pub size_head: u16,
pub size_nose: u16,
pub size_nosepoint: u16,
pub size_nostril: u16,
pub size_mouth: u16,
pub size_lips: u16,
pub size_eyes: u16,
pub size_eyelid: u16,
pub size_eyearea: u16,
pub size_eyelash: u16,
pub size_eyelashcurve: u16,
pub size_ear: u16,
pub size_chin: u16,
pub size_face: u16,
pub size_forehead: u16,
pub size_cheek: u16,
pub size_mustache: u16,
pub size_beard: u16,
pub size_sidehair: u16,
pub size_bodyhair: u16,
pub size_chinextend: u16,
pub size_backhead: u16,
pub size_longhair: u16,
pub size_hips: u16,
pub size_waist: u16,
pub size_ankle: u16,
pub size_foothair: u16,
pub size_armpithair: u16,
pub size_nosehair: u16,
pub thickness_eyebrow: u16,
pub width_eyebrow: u16,
pub roundness_body: u16,
pub roundness_finger: u16,
pub roundness_head: u16,
pub roundness_ear: u16,
pub len_nail: u16,
pub len_arm: u16,
pub dist_eye: u16,
pub skin: u16,
pub has_freckles: u16,
pub has_teeth: u16,
pub color_teeth: u16,
pub color_lip: u16,
pub color_skinhue: u16,
pub color_skinshade: u16,
pub color_headhair1: u32,
pub color_headhair2: u32,
pub color_headhair3: u32,
pub color_bodyhair: u32,
pub color_mustache: u32,
pub color_beard: u32,
pub color_foothair: u32,
pub color_armpithair: u32,
pub color_eyelash: u32,
pub color_eyebrow: u32,
pub color_eye: u32,
pub color_fingertoenail: u32,
pub voice_pitch: u16,
pub voice_waveform: u16,
}
impl Bloke {
pub fn save(&self) -> Vec<u8> {
serialize(self).unwrap()
}
pub fn load(data: &[u8]) -> Bloke {
deserialize(data).unwrap()
}
}
#[cfg(test)]
mod tests {
#[test]
fn filesize() {
assert_eq!(std::mem::size_of::<crate::Bloke>(), 192)
}
}