use bytes::BytesMut;
use super::{general_appearance_record::GeneralAppearanceRecord, specific_appearance_record::SpecificAppearanceRecord};
#[derive(Copy, Clone, Debug,)]
pub struct EntityAppearanceRecord {
pub general_appearance_record: GeneralAppearanceRecord,
pub specific_appearance_record: SpecificAppearanceRecord
}
impl EntityAppearanceRecord {
pub fn new(general_appearance_record: GeneralAppearanceRecord, specific_appearance_record: SpecificAppearanceRecord) -> Self {
EntityAppearanceRecord {
general_appearance_record,
specific_appearance_record
}
}
pub fn default() -> Self {
EntityAppearanceRecord {
general_appearance_record: GeneralAppearanceRecord::default(),
specific_appearance_record: SpecificAppearanceRecord::default()
}
}
pub fn serialize(&self, buf: &mut BytesMut) {
self.general_appearance_record.serialize(buf);
self.specific_appearance_record.serialize(buf);
}
pub fn decode(buf: &mut BytesMut) -> EntityAppearanceRecord {
EntityAppearanceRecord {
general_appearance_record: GeneralAppearanceRecord::decode(buf),
specific_appearance_record: SpecificAppearanceRecord::decode(buf)
}
}
}