Add basic example for parsing the ancient demos with and without entities
This was mainly done to both start having some examples and try out the API. They also serve as a starting point for benchmarking
This commit is contained in:
12
examples/ancient-entity.rs
Normal file
12
examples/ancient-entity.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
const DATA: &[u8] = include_bytes!("../testfiles/de_ancient.dem");
|
||||
|
||||
fn main() {
|
||||
let container = csdemo::Container::parse(DATA).unwrap();
|
||||
|
||||
let output = csdemo::parser::parse(csdemo::FrameIterator::parse(container.inner), csdemo::parser::EntityFilter::all()).unwrap();
|
||||
|
||||
println!("Header: {:?}", output.header);
|
||||
println!("Players: {:?}", output.player_info);
|
||||
println!("Events: {:?}", output.events.len());
|
||||
println!("Entities: {:?}", output.entity_states.len());
|
||||
}
|
||||
12
examples/ancient-noentity.rs
Normal file
12
examples/ancient-noentity.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
const DATA: &[u8] = include_bytes!("../testfiles/de_ancient.dem");
|
||||
|
||||
fn main() {
|
||||
let container = csdemo::Container::parse(DATA).unwrap();
|
||||
|
||||
let output = csdemo::parser::parse(csdemo::FrameIterator::parse(container.inner), csdemo::parser::EntityFilter::disabled()).unwrap();
|
||||
|
||||
println!("Header: {:?}", output.header);
|
||||
println!("Players: {:?}", output.player_info);
|
||||
println!("Events: {:?}", output.events.len());
|
||||
println!("Entities: {:?}", output.entity_states.len());
|
||||
}
|
||||
Reference in New Issue
Block a user