veloren/server/src/persistence/json_models.rs

32 lines
791 B
Rust
Raw Normal View History

use common::comp;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize)]
pub struct HumanoidBody {
pub species: u8,
pub body_type: u8,
pub hair_style: u8,
pub beard: u8,
pub eyes: u8,
pub accessory: u8,
pub hair_color: u8,
pub skin: u8,
pub eye_color: u8,
}
impl From<&comp::humanoid::Body> for HumanoidBody {
fn from(body: &comp::humanoid::Body) -> Self {
HumanoidBody {
species: body.species as u8,
body_type: body.body_type as u8,
hair_style: body.hair_style,
beard: body.beard,
eyes: body.eyes,
accessory: body.accessory,
hair_color: body.hair_color,
skin: body.skin,
eye_color: body.eye_color,
}
}
}