work around broken binrw enums

This commit is contained in:
Quaternions 2024-07-26 16:57:41 -07:00
parent 020eae4781
commit b6fede20bf

View File

@ -46,10 +46,15 @@ impl From<strafesnet_common::gameplay_attributes::ContactingLadder> for Contacti
#[binrw::binrw]
#[brw(little)]
pub enum ContactingBehaviour{
#[brw(magic=0u8)]
Surf,
#[brw(magic=1u8)]
Ladder(ContactingLadder),
#[brw(magic=2u8)]
NoJump,
#[brw(magic=3u8)]
Cling,
#[brw(magic=4u8)]
Elastic(u32),
}
impl Into<strafesnet_common::gameplay_attributes::ContactingBehaviour> for ContactingBehaviour{
@ -138,7 +143,9 @@ impl From<strafesnet_common::gameplay_attributes::Accelerator> for Accelerator{
#[binrw::binrw]
#[brw(little)]
pub enum Booster{
#[brw(magic=0u8)]
Velocity(Planar64Vec3),
#[brw(magic=1u8)]
Energy{direction:Planar64Vec3,energy:Planar64},
}
impl Into<strafesnet_common::gameplay_attributes::Booster> for Booster{
@ -200,18 +207,24 @@ impl From<strafesnet_common::gameplay_attributes::TrajectoryChoice> for Trajecto
#[binrw::binrw]
#[brw(little)]
pub enum SetTrajectory{
#[brw(magic=0u8)]
AirTime(Time),
#[brw(magic=1u8)]
Height(Planar64),
#[brw(magic=2u8)]
DotVelocity{direction:Planar64Vec3,dot:Planar64},
#[brw(magic=3u8)]
TargetPointTime{
target_point:Planar64Vec3,
time:Time,
},
#[brw(magic=4u8)]
TargetPointSpeed{
target_point:Planar64Vec3,
speed:Planar64,
trajectory_choice:TrajectoryChoice,
},
#[brw(magic=5u8)]
Velocity(Planar64Vec3),
}
impl Into<strafesnet_common::gameplay_attributes::SetTrajectory> for SetTrajectory{
@ -400,11 +413,14 @@ impl From<strafesnet_common::gameplay_attributes::IntersectingAttributes> for In
#[binrw::binrw]
#[brw(little)]
pub enum CollisionAttributes{
#[brw(magic=0u8)]
Decoration,
#[brw(magic=1u8)]
Contact{
contacting:ContactingAttributes,
general:GeneralAttributes,
},
#[brw(magic=2u8)]
Intersect{
intersecting:IntersectingAttributes,
general:GeneralAttributes,