mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-04 02:24:12 +02:00
analyser cleanup
This commit is contained in:
parent
c529abc6fb
commit
4320f2941c
2 changed files with 48 additions and 29 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue