strafe-client/lib/snf/src/demo.rs

40 lines
745 B
Rust
Raw Normal View History

2024-01-19 03:28:01 +00:00
use binrw::BinReaderExt;
2024-07-26 00:47:00 +00:00
#[derive(Debug)]
2024-01-16 03:09:34 +00:00
pub enum Error{
2024-01-19 00:39:58 +00:00
InvalidHeader,
2024-01-16 03:09:34 +00:00
}
/*
BLOCK_DEMO_HEADER:
2025-01-07 07:14:04 +00:00
u32 num_maps
for map_id in 0..num_maps{
i64 simulation_time
u128 map_resource_id
u64 map_header_block_id
}
2024-01-18 23:33:22 +00:00
u32 num_bots
for bot_id in 0..num_bots{
2025-01-07 07:14:04 +00:00
i64 simulation_time
2024-01-18 23:33:22 +00:00
u128 bot_resource_id
u64 bot_header_block_id
}
2025-01-07 07:14:04 +00:00
//map loading timeline
2024-01-18 23:33:22 +00:00
//bot loading timeline
how to do worldstate for deathrun!?
2025-01-07 07:14:04 +00:00
- this is done in the client, there is no worldstate in the demo file
2024-01-18 23:33:22 +00:00
2024-01-16 03:09:34 +00:00
*/
2024-01-19 03:28:01 +00:00
pub struct StreamableDemo<R:BinReaderExt>{
2025-01-07 07:14:04 +00:00
map:Vec<crate::map::StreamableMap<R>>,
2024-01-19 03:28:01 +00:00
bots:Vec<crate::bot::StreamableBot<R>>,
2024-01-19 00:39:58 +00:00
}
2024-01-19 03:28:01 +00:00
impl<R:BinReaderExt> StreamableDemo<R>{
pub(crate) fn new(file:crate::file::File<R>)->Result<Self,Error>{
2024-01-19 00:39:58 +00:00
Err(Error::InvalidHeader)
}
2024-07-26 00:47:00 +00:00
}