2025-02-23 16:14:44 -05:00
|
|
|
use binrw::binrw;
|
2025-02-24 00:30:16 -05:00
|
|
|
use std::fmt;
|
2025-02-23 16:14:44 -05:00
|
|
|
|
|
|
|
// See https://dev.epicgames.com/documentation/en-us/unreal-engine/API/Runtime/Core/Misc/FGuid
|
|
|
|
#[binrw]
|
|
|
|
pub struct Guid {
|
|
|
|
pub a: u32,
|
|
|
|
pub b: u32,
|
|
|
|
pub c: u32,
|
2025-02-24 00:30:16 -05:00
|
|
|
pub d: u32,
|
2025-02-23 16:14:44 -05:00
|
|
|
}
|
|
|
|
|
2025-03-02 14:07:39 -05:00
|
|
|
impl crate::structs::PropertyBase for Guid {
|
|
|
|
fn type_name() -> &'static str {
|
2025-03-02 14:13:41 -05:00
|
|
|
"StructProperty"
|
2025-03-02 14:07:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn struct_name() -> Option<&'static str> {
|
2025-03-02 14:13:41 -05:00
|
|
|
Some("Guid")
|
2025-03-02 14:07:39 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn size_in_bytes(&self) -> u32 {
|
|
|
|
16
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2025-02-23 16:14:44 -05:00
|
|
|
impl fmt::Debug for Guid {
|
|
|
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
2025-02-24 00:30:16 -05:00
|
|
|
f.write_str(&format!(
|
|
|
|
"{:02X}{:02X}{:02X}{:02X}",
|
|
|
|
self.a, self.b, self.c, self.d
|
|
|
|
))
|
2025-02-23 16:14:44 -05:00
|
|
|
}
|
|
|
|
}
|