1
0
Fork 0
mirror of https://codeberg.org/demostf/parser.git synced 2026-06-03 10:14:06 +02:00

parser api wip

This commit is contained in:
Robin Appelman 2019-12-22 15:47:00 +01:00
commit 42358f243b
12 changed files with 52 additions and 56 deletions

View file

@ -107,7 +107,7 @@ impl MessageHandler for EntityDumper {
}
}
fn get_output(self, state: &ParserState) -> Self::Output {
fn into_output(self, state: &ParserState) -> Self::Output {
self.entities
.into_iter()
.map(|(tick, entity)| EntityDump::from_entity(entity, tick, &state.server_classes))
@ -119,7 +119,7 @@ fn entity_test(input_file: &str, snapshot_file: &str) {
let file = fs::read(input_file).expect("Unable to read file");
let demo = Demo::new(file);
let (_, entities) =
DemoParser::parse_with_analyser(demo.get_stream(), EntityDumper::new()).unwrap();
DemoParser::new_with_analyser(demo.get_stream(), EntityDumper::new()).unwrap();
let json_file = File::open(snapshot_file).expect("Unable to read file");
let mut reader = BufReader::new(json_file);