diff --git a/src/newtypes.rs b/src/newtypes.rs index 8b12c6b..19e2e59 100644 --- a/src/newtypes.rs +++ b/src/newtypes.rs @@ -1,3 +1,4 @@ +mod common; pub mod aabb; pub mod model; pub mod integer; diff --git a/src/newtypes/common.rs b/src/newtypes/common.rs new file mode 100644 index 0000000..88ffac7 --- /dev/null +++ b/src/newtypes/common.rs @@ -0,0 +1,22 @@ +#[binrw::binrw] +#[brw(little,repr=u8)] +pub enum Boolio{ + True, + False +} +impl Into for Boolio{ + fn into(self)->bool{ + match self{ + Boolio::True=>true, + Boolio::False=>false, + } + } +} +impl From for Boolio{ + fn from(value:bool)->Self{ + match value{ + true=>Boolio::True, + false=>Boolio::False, + } + } +}