1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-04 02:24:12 +02:00

analyser cleanup

This commit is contained in:
Robin Appelman 2019-08-25 23:49:21 +02:00
commit 4320f2941c
2 changed files with 48 additions and 29 deletions

View file

@ -5,16 +5,26 @@ use crate::demo::packet::datatable::ServerClass;
use crate::demo::parser::ParseBitSkip;
use crate::demo::sendprop::SendProp;
use crate::{Parse, ParseError, ParserState, Result, Stream};
use std::num::ParseIntError;
use std::str::FromStr;
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct EntityId(u32);
impl EntityId {
pub fn new(num: u32) -> Self {
impl From<u32> for EntityId {
fn from(num: u32) -> Self {
EntityId(num)
}
}
impl FromStr for EntityId {
type Err = ParseIntError;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
u32::from_str(s).map(EntityId::from)
}
}
#[derive(BitRead, Clone, Copy, Debug)]
#[discriminant_bits = 3]
pub enum PVS {