convenient impl
This commit is contained in:
parent
1f78c98c6f
commit
22543defa8
@ -2,12 +2,21 @@ use binrw::{binrw,BinReaderExt,io::TakeSeekExt};
|
|||||||
|
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[brw(little)]
|
#[brw(little)]
|
||||||
|
#[derive(Clone,Copy,Debug)]
|
||||||
pub enum Bool{
|
pub enum Bool{
|
||||||
#[brw(magic=0u32)]
|
#[brw(magic=0u32)]
|
||||||
False,
|
False,
|
||||||
#[brw(magic=1u32)]
|
#[brw(magic=1u32)]
|
||||||
True,
|
True,
|
||||||
}
|
}
|
||||||
|
impl Into<bool> for Bool{
|
||||||
|
fn into(self)->bool{
|
||||||
|
match self{
|
||||||
|
Bool::False=>false,
|
||||||
|
Bool::True=>true,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
#[binrw]
|
#[binrw]
|
||||||
#[brw(little)]
|
#[brw(little)]
|
||||||
pub struct Vector2{
|
pub struct Vector2{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user