dem 0.3.0

GoldSrc demo parser and writer library
Documentation
use super::*;

impl Doer for SvcFinale {
    fn id(&self) -> u8 {
        31
    }

    fn parse<'a>(i: &'a [u8], _: &mut DemoGlobalState) -> NomResult<'a, Self> {
        map(null_string, |text| SvcFinale {
            text: text.to_owned(),
        })(i)
    }

    fn write(&self, _: &DemoGlobalState) -> ByteVec {
        let mut writer = ByteWriter::new();

        writer.append_u8(self.id());

        writer.append_u8_slice(&self.text);

        writer.data
    }
}