From 17a7e7b738c70712e5b159517173c71c0c764590 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Mon, 29 Jul 2024 13:30:48 -0700 Subject: [PATCH] boolio --- src/newtypes/gameplay_attributes.rs | 9 +++------ src/newtypes/gameplay_modes.rs | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/src/newtypes/gameplay_attributes.rs b/src/newtypes/gameplay_attributes.rs index 743d9cc..a2b0df0 100644 --- a/src/newtypes/gameplay_attributes.rs +++ b/src/newtypes/gameplay_attributes.rs @@ -3,22 +3,19 @@ use super::integer::{Time,Planar64,Planar64Vec3}; #[binrw::binrw] #[brw(little)] pub struct ContactingLadder{ - pub sticky:Option<()>, + pub sticky:super::common::Boolio, } impl Into for ContactingLadder{ fn into(self)->strafesnet_common::gameplay_attributes::ContactingLadder{ strafesnet_common::gameplay_attributes::ContactingLadder{ - sticky:self.sticky.is_some(), + sticky:self.sticky.into(), } } } impl From for ContactingLadder{ fn from(value:strafesnet_common::gameplay_attributes::ContactingLadder)->Self{ Self{ - sticky:match value.sticky{ - true=>Some(()), - false=>None, - } + sticky:value.sticky.into(), } } } diff --git a/src/newtypes/gameplay_modes.rs b/src/newtypes/gameplay_modes.rs index aa7848e..a6118fe 100644 --- a/src/newtypes/gameplay_modes.rs +++ b/src/newtypes/gameplay_modes.rs @@ -41,13 +41,13 @@ pub struct StageElement{ pub stage_id:u32,//which stage spawn to send to pub behaviour:StageElementBehaviour, pub jump_limit:Option, - pub force:Option<()>,//allow setting to lower spawn id i.e. 7->3 + pub force:super::common::Boolio,//allow setting to lower spawn id i.e. 7->3 } impl Into for StageElement{ fn into(self)->strafesnet_common::gameplay_modes::StageElement{ strafesnet_common::gameplay_modes::StageElement::new( strafesnet_common::gameplay_modes::StageId::new(self.stage_id), - self.force.is_some(), + self.force.into(), self.behaviour.into(), self.jump_limit, ) @@ -59,7 +59,7 @@ impl From for StageElement{ stage_id:value.stage_id().get(), behaviour:value.behaviour().into(), jump_limit:value.jump_limit(), - force:match value.force(){true=>Some(()),false=>None}, + force:value.force().into(), } } }