#![allow(nonstandard_style)]
use brickworks::br_print;
use crate::ue::fname::FName;
use super::fproperty::*;
use super::tarray::*;
use super::ffield::*;
use super::coreuobject::*;
pub(crate) static mut UClass_FindFunctionByName_ptr: Option<unsafe extern "C" fn (cls: *const UClass, name: FName, inherit: u32) -> *mut UFunction> = None;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct UField {
pub uobject: UObject,
pub next: *const UField,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct FStructBaseChain {
pub struct_base_chain_array: *const *const FStructBaseChain,
pub num_struct_bases_in_chain_minus_one: i32,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct UStruct {
pub ufield: UField,
pub fstruct_base_chain: FStructBaseChain,
pub super_struct: *const UStruct,
pub children: *const UField,
pub child_properties: *const FField,
pub properties_size: i32,
pub min_alignment: i32,
pub script: TArray<u8>,
pub property_link: *const FProperty,
pub ref_link: *const FProperty,
pub destructor_link: *const FProperty,
pub post_construct_link: *const FProperty,
pub script_and_property_object_references: TArray<*const UObject>,
pub unresolved_script_properties: *const (), pub unversioned_schema: *const (), }
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct UClass {
pub ustruct: UStruct,
}
impl UClass
{
pub unsafe fn FindFunctionByName(&self, name: &'static str, inherit: bool ) -> *mut UFunction
{
let n = FName::search_str(name);
(UClass_FindFunctionByName_ptr.unwrap())(self, n, inherit as u32)
}
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct UFunction {
pub ustruct: UStruct,
}
impl UStruct
{
pub unsafe fn IsChildOf(&self, other: *const UStruct) -> bool
{
let mut current = self as *const UStruct;
loop {
if current == other
{
return true;
}
current = (*current).super_struct;
if current.is_null()
{
return false
}
}
}
}
unsafe extern "C"
{
}