mirror of
https://codeberg.org/demostf/parser.git
synced 2026-06-03 18:24:05 +02:00
made DemoTicker cloneable
This commit is contained in:
parent
2e740c8f2f
commit
b7e6db1f4f
5 changed files with 7 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ pub struct CreateStringTableMessage<'a> {
|
|||
pub table: Box<StringTable<'a>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct StringTableMeta {
|
||||
pub max_entries: u16,
|
||||
pub fixed_userdata_size: Option<FixedUserDataSize>,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ pub trait BorrowMessageHandler: MessageHandler {
|
|||
fn borrow_output(&self, state: &ParserState) -> &Self::Output;
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct DemoHandler<'a, T: MessageHandler> {
|
||||
pub tick: u32,
|
||||
string_table_names: Vec<Cow<'a, str>>,
|
||||
|
|
|
|||
|
|
@ -92,6 +92,7 @@ impl<'a, A: MessageHandler> DemoParser<'a, A> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct RawPacketStream<'a> {
|
||||
stream: Stream<'a>,
|
||||
ended: bool,
|
||||
|
|
|
|||
|
|
@ -16,13 +16,14 @@ use crate::nullhasher::NullHasherBuilder;
|
|||
use crate::{Result, Stream};
|
||||
use std::cell::RefCell;
|
||||
|
||||
#[derive(Default)]
|
||||
#[derive(Default, Clone)]
|
||||
pub struct DemoMeta {
|
||||
pub version: u16,
|
||||
pub game: String,
|
||||
pub interval_per_tick: f32,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct ParserState {
|
||||
pub static_baselines: HashMap<ClassId, StaticBaseline, NullHasherBuilder>,
|
||||
pub parsed_static_baselines: RefCell<HashMap<ClassId, Vec<SendProp>, NullHasherBuilder>>,
|
||||
|
|
@ -38,6 +39,7 @@ pub struct ParserState {
|
|||
parse_all: bool,
|
||||
}
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct StaticBaseline {
|
||||
pub class_id: ClassId,
|
||||
pub raw: Stream<'static>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue