From bfcf9735248fd79092878cd8ed1cffe7e6c240f3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 5 Aug 2024 17:26:46 -0700 Subject: [PATCH] rethink physics instructions --- src/newtypes/physics.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/newtypes/physics.rs b/src/newtypes/physics.rs index 0482df6..5a2f85b 100644 --- a/src/newtypes/physics.rs +++ b/src/newtypes/physics.rs @@ -24,12 +24,14 @@ pub enum PhysicsInputInstruction{ #[brw(magic=9u8)] SetZoom(Boolio), #[brw(magic=10u8)] - Restart, + Reset, #[brw(magic=11u8)] - Spawn(super::gameplay_modes::ModeId,super::gameplay_modes::StageId), + Restart, #[brw(magic=12u8)] - PracticeFly, + Spawn(super::gameplay_modes::ModeId,super::gameplay_modes::StageId), #[brw(magic=13u8)] + PracticeFly, + #[brw(magic=14u8)] SetSensitivity(super::integer::Ratio64Vec2), } #[derive(Debug)] @@ -57,6 +59,7 @@ impl TryInto for PhysicsInputInstructio PhysicsInputInstruction::SetMoveForward(state)=>strafesnet_common::physics::Instruction::SetMoveForward(state.into()), PhysicsInputInstruction::SetJump(state)=>strafesnet_common::physics::Instruction::SetJump(state.into()), PhysicsInputInstruction::SetZoom(state)=>strafesnet_common::physics::Instruction::SetZoom(state.into()), + PhysicsInputInstruction::Reset=>strafesnet_common::physics::Instruction::Reset, PhysicsInputInstruction::Restart=>strafesnet_common::physics::Instruction::Restart, PhysicsInputInstruction::Spawn(mode_id,stage_id)=>strafesnet_common::physics::Instruction::Spawn( strafesnet_common::gameplay_modes::ModeId::new(mode_id), @@ -81,6 +84,7 @@ impl TryFrom for PhysicsInputInstructio strafesnet_common::physics::Instruction::SetMoveForward(state)=>Ok(PhysicsInputInstruction::SetMoveForward(state.into())), strafesnet_common::physics::Instruction::SetJump(state)=>Ok(PhysicsInputInstruction::SetJump(state.into())), strafesnet_common::physics::Instruction::SetZoom(state)=>Ok(PhysicsInputInstruction::SetZoom(state.into())), + strafesnet_common::physics::Instruction::Reset=>Ok(PhysicsInputInstruction::Reset), strafesnet_common::physics::Instruction::Restart=>Ok(PhysicsInputInstruction::Restart), strafesnet_common::physics::Instruction::Spawn(mode_id,stage_id)=>Ok(PhysicsInputInstruction::Spawn( mode_id.get(),