pub enum Error{ InvalidHeader, InvalidSegment, } /* block types BLOCK_BOT_HEADER: u128 map_resource_uuid //which map is this bot running //don't include style info in bot header because it's in the simulation state //blocks are laid out in chronological order, but indices may jump around. u64 num_segments for _ in 0..num_segments{ i64 time //simulation_state timestamp u64 block_id } BLOCK_BOT_SEGMENT: //format version indicates what version of these structures to use SimulationState simulation_state //SimulationState is just under ClientState which includes Play/Pause events that the simulation doesn't know about. //to read, greedily decode instructions until eof loop{ //delta encode as much as possible (time,mousepos) //strafe ticks are implied //physics can be implied in an input-only bot file TimedInstruction instruction } */ //xdd mod simulation{ pub struct State{} pub struct Instruction{} } mod instruction{ pub struct TimedInstruction{instruction:Instruction} } mod timeline{ pub struct Timeline{timeline:Vec>} } //serious code struct SegmentId(u64); pub struct Segment{ state:simulation::State, instructions:Vec> } pub struct StreamableBot{ file:crate::file::File, timeline:timeline::Timeline, } impl StreamableBot{ pub fn new(file:crate::file::File)->Result{ Err(Error::InvalidHeader) } pub fn load_segment(&mut self,segment_id:u64)->Result{ //load region from disk //parse the models and determine what resources need to be loaded //load resources into self.resources //return Region Err(Error::InvalidSegment) } }