lol idk #1

Closed
Quaternions wants to merge 1062 commits from StrafesNET/strafe-project:master into master
Showing only changes of commit 62851bbd60 - Show all commits

@ -46,9 +46,7 @@ pub struct InstructionCollector<I,T>{
time:T,
instruction:Option<I>,
}
impl<I,T> InstructionCollector<I,T>
where T:Copy+PartialOrd,
{
impl<I,T> InstructionCollector<I,T>{
#[inline]
pub const fn new(time:T)->Self{
Self{
@ -57,19 +55,6 @@ impl<I,T> InstructionCollector<I,T>
}
}
#[inline]
pub const fn time(&self)->T{
self.time
}
#[inline]
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
if let Some(ins)=instruction{
if ins.time<self.time{
self.time=ins.time;
self.instruction=Some(ins.instruction);
}
}
}
#[inline]
pub fn take(self)->Option<TimedInstruction<I,T>>{
//STEAL INSTRUCTION AND DESTROY INSTRUCTIONCOLLECTOR
self.instruction.map(|instruction|TimedInstruction{
@ -78,3 +63,20 @@ impl<I,T> InstructionCollector<I,T>
})
}
}
impl<I,T:Copy> InstructionCollector<I,T>{
#[inline]
pub const fn time(&self)->T{
self.time
}
}
impl<I,T:PartialOrd> InstructionCollector<I,T>{
#[inline]
pub fn collect(&mut self,instruction:Option<TimedInstruction<I,T>>){
if let Some(ins)=instruction{
if ins.time<self.time{
self.time=ins.time;
self.instruction=Some(ins.instruction);
}
}
}
}