lol idk #1

Open
Quaternions wants to merge 826 commits from StrafesNET/strafe-project:master into master
2 changed files with 5 additions and 3 deletions
Showing only changes of commit 77db5a7a6b - Show all commits

View File

@ -62,6 +62,7 @@ impl<I,T> InstructionCollector<I,T>
pub const fn time(&self)->Time<T>{
self.time
}
#[inline]
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
if let Some(ins)=instruction{
if ins.time<self.time{
@ -70,7 +71,8 @@ impl<I,T> InstructionCollector<I,T>
}
}
}
pub fn instruction(self)->Option<TimedInstruction<I,T>>{
#[inline]
pub fn take(self)->Option<TimedInstruction<I,T>>{
//STEAL INSTRUCTION AND DESTROY INSTRUCTIONCOLLECTOR
self.instruction.map(|instruction|TimedInstruction{
time:self.time,

View File

@ -1111,7 +1111,7 @@ impl PhysicsData{
//this is the one who asks
fn next_instruction_internal(state:&PhysicsState,data:&PhysicsData,time_limit:Time)->Option<TimedInstruction<InternalInstruction,TimeInner>>{
//JUST POLLING!!! NO MUTATION
let mut collector = instruction::InstructionCollector::new(time_limit);
let mut collector=instruction::InstructionCollector::new(time_limit);
collector.collect(state.next_move_instruction());
@ -1145,7 +1145,7 @@ impl PhysicsData{
)
);
});
collector.instruction()
collector.take()
}