49 lines
1.1 KiB
Rust
49 lines
1.1 KiB
Rust
use std::marker::PhantomData;
|
|
|
|
use crate::{fname::FName, tarray::FString};
|
|
|
|
#[repr(C)]
|
|
#[derive(Debug)]
|
|
pub struct TWeakObjectPtr<T> {
|
|
object_index: u32,
|
|
serial_number: u32,
|
|
phantom: PhantomData<T>,
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Debug)]
|
|
pub struct TPersistentObjectPtr<T, P> {
|
|
weak: TWeakObjectPtr<T>,
|
|
tag_at_last_test: u32,
|
|
object_id: P,
|
|
}
|
|
|
|
pub type TLazyObjectPtr<T> = TPersistentObjectPtr<T, [u8; 0x10]>;
|
|
pub type TSoftObjectPtr<T> = TPersistentObjectPtr<T, FSoftObjectPath>;
|
|
|
|
#[repr(C)]
|
|
#[derive(Debug)]
|
|
pub struct FSoftObjectPath {
|
|
asset_path_name: FName,
|
|
sub_path_string: FString,
|
|
}
|
|
|
|
#[repr(C)]
|
|
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
|
pub struct TEnumAsByte<T> {
|
|
inner: u8,
|
|
phantom: PhantomData<T>,
|
|
}
|
|
|
|
impl<T> TEnumAsByte<T> {
|
|
pub fn as_enum(&self) -> &T {
|
|
unsafe { &*core::mem::transmute::<_, *const T>(&self.inner as *const u8) }
|
|
}
|
|
pub fn as_mut_enum(&mut self) -> &mut T {
|
|
unsafe { &mut *core::mem::transmute::<_, *mut T>(&mut self.inner as *mut u8) }
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct FText([u8; 0x28]);
|