commonlibsse_ng\skse\interfaces/
object.rs1use crate::skse::impls::stab::{
11 SKSEDelayFunctorManager, SKSEObjectInterface, SKSEObjectRegistry, SKSEPersistentObjectStorage,
12};
13
14#[derive(Debug, Clone)]
15#[repr(transparent)]
16pub struct ObjectInterface(&'static SKSEObjectInterface);
17
18impl ObjectInterface {
19 pub const VERSION: u32 = 2;
20
21 #[inline]
22 pub(crate) const fn new(interface: &'static SKSEObjectInterface) -> Self {
23 Self(interface)
24 }
25
26 #[inline]
27 pub const fn version(&self) -> u32 {
28 self.0.interfaceVersion
29 }
30
31 #[inline]
32 pub fn get_delay_functor_manager(&self) -> *mut SKSEDelayFunctorManager {
33 unsafe { (self.0.GetDelayFunctorManager)() }
34 }
35
36 #[inline]
37 pub fn get_object_registry(&self) -> *mut SKSEObjectRegistry {
38 unsafe { (self.0.GetObjectRegistry)() }
39 }
40
41 #[inline]
42 pub fn get_persistent_object_storage(&self) -> *mut SKSEPersistentObjectStorage {
43 unsafe { (self.0.GetPersistentObjectStorage)() }
44 }
45}