refactor physics enums so Mouse-NonMouse distinction is private to mouse_interpolator

This commit is contained in:
2025-01-15 21:09:08 -08:00
parent 814e573d91
commit 7f9a16a56d
4 changed files with 111 additions and 75 deletions

View File

@@ -7,17 +7,13 @@ pub type Time=crate::integer::Time<TimeInner>;
#[derive(Clone,Debug)]
pub enum Instruction{
Mouse(MouseInstruction),
NonMouse(NonMouseInstruction),
}
impl Instruction{
pub const IDLE:Self=Self::NonMouse(NonMouseInstruction::Misc(MiscInstruction::Idle));
}
#[derive(Clone,Debug)]
pub enum NonMouseInstruction{
SetControl(SetControlInstruction),
Mode(ModeInstruction),
Misc(MiscInstruction),
}
impl Instruction{
pub const IDLE:Self=Self::Misc(MiscInstruction::Idle);
}
#[derive(Clone,Debug)]
pub enum MouseInstruction{
/// Replace the entire interpolation state to avoid dividing by zero when replacing twice