Skip to main content

engage/generated/app/
hubresource.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "app-hubresource-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::{
9        app::singletonclass_1::{ISingletonClass_1, SingletonClass_1},
10        system::object::{IObject, Object},
11    };
12
13    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/app/hubresource/HubResource.md"))]
14    #[::unity::class(namespace = "App", name = "HubResource")]
15    #[parent(crate::app::singletonclass_1::SingletonClass_1<crate::app::hubresource::HubResource>)]
16    pub struct HubResource {
17        #[offset(32)]
18        #[rename(name = "resources")]
19        pub resources:
20            crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, crate::app::resourcehandle_2::ResourceHandle_2>,
21    }
22}
23
24#[cfg(feature = "app-hubresource-types")]
25pub use __types::*;
26
27#[cfg(feature = "app-hubresource")]
28pub trait IHubResourceMethods: IHubResource {
29    fn get<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> M0 {
30        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
31            ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<HubResource as ::unity::ClassIdentity>::class(), "Get", 1));
32        #[allow(clippy::type_complexity)]
33        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
34            ::std::sync::OnceLock::new();
35        let _ = false;
36        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
37            ::core::result::Result::Ok(mi) => *mi,
38            ::core::result::Result::Err(e) => {
39                panic!(
40                    "method lookup failed: {}
41::{}
42: {}
43",
44                    <HubResource as ::unity::ClassIdentity>::NAME,
45                    "Get",
46                    e
47                )
48            },
49        };
50        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
51        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
52        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
53            let mut __guard = __cache.lock().unwrap();
54            *__guard
55                .entry(__key)
56                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
57        };
58        unsafe {
59            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
60            let __f: extern "C" fn(HubResource, ::unity::Il2CppString, ::unity::OptionalMethod) -> M0 = ::core::mem::transmute(__inflated.method_ptr);
61            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
62            __f(__receiver, ::core::convert::Into::into(name), ::core::option::Option::Some(__mi_opaque))
63        }
64    }
65    #[doc = "`IsLoading()` overload"]
66    fn is_loading(self) -> bool {
67        unsafe {
68            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
69            ::unity::il2cpp_call!((::unity::module_base()+0x23eb030usize)as*mut u8,bool;
70(HubResource)__receiver)
71        }
72    }
73    #[doc = "`OnCreate()` overload"]
74    fn on_create(self) -> () {
75        unsafe {
76            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
77            {
78                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
79                let __vi = *__vt.get(5usize).unwrap_or_else(|| {
80                    panic!(
81                        "unity: virtual slot {}
82 out of range (vtable len {}
83) on the runtime class behind {}
84 (method `{}
85`)",
86                        5usize,
87                        __vt.len(),
88                        <HubResource as ::unity::ClassIdentity>::NAME,
89                        "OnCreate",
90                    )
91                });
92                let __inner: extern "C" fn(HubResource, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
93                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
94                __inner(__receiver, __mi)
95            }
96        }
97    }
98    #[doc = "`OnDispose()` overload"]
99    fn on_dispose(self) -> () {
100        unsafe {
101            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
102            {
103                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
104                let __vi = *__vt.get(6usize).unwrap_or_else(|| {
105                    panic!(
106                        "unity: virtual slot {}
107 out of range (vtable len {}
108) on the runtime class behind {}
109 (method `{}
110`)",
111                        6usize,
112                        __vt.len(),
113                        <HubResource as ::unity::ClassIdentity>::NAME,
114                        "OnDispose",
115                    )
116                });
117                let __inner: extern "C" fn(HubResource, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
118                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
119                __inner(__receiver, __mi)
120            }
121        }
122    }
123    #[doc = "`Add(::unity::Il2CppString)` overload"]
124    fn add(self, path: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
125        unsafe {
126            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
127            ::unity::il2cpp_call!((::unity::module_base()+0x23eb290usize)as*mut u8,();
128(HubResource)__receiver,(::unity::Il2CppString)::core::convert::Into::into(path))
129        }
130    }
131    #[doc = "`.ctor()` overload"]
132    fn ctor(self) -> () {
133        unsafe {
134            let __receiver = <HubResource as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
135            ::unity::il2cpp_call!((::unity::module_base()+0x23eb4e0usize)as*mut u8,();
136(HubResource)__receiver)
137        }
138    }
139}
140
141#[cfg(feature = "app-hubresource")]
142impl<__T: IHubResource> IHubResourceMethods for __T {}
143
144#[cfg(feature = "app-hubresource")]
145impl HubResource {
146    pub fn is_loading_method_info() -> &'static ::unity::il2cpp::MethodInfo {
147        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
148    }
149
150    pub fn on_create_method_info() -> &'static ::unity::il2cpp::MethodInfo {
151        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
152    }
153
154    pub fn on_dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
155        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
156    }
157
158    pub fn add_method_info() -> &'static ::unity::il2cpp::MethodInfo {
159        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
160    }
161
162    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
163        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
164    }
165}
166
167#[cfg(feature = "app-hubresource")]
168impl HubResource {
169    #[doc = "Direct (non-virtual) call to `HubResource`'s own `OnCreate`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
170    pub unsafe fn on_create(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
171        let __mi = Self::on_create_method_info();
172        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
173        __inner(this.into(), ::core::option::Option::None)
174    }
175
176    #[doc = "Direct (non-virtual) call to `HubResource`'s own `OnDispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
177    pub unsafe fn on_dispose(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
178        let __mi = Self::on_dispose_method_info();
179        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
180        __inner(this.into(), ::core::option::Option::None)
181    }
182}
183
184#[cfg(feature = "app-hubresource")]
185impl HubResource {
186    #[doc = "`.ctor()` — no args"]
187    pub fn new() -> Self {
188        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
189            panic!(
190                "{}
191::{}
192 failed to instantiate",
193                ::core::stringify!(HubResource),
194                ::core::stringify!(new),
195            )
196        });
197        <Self as IHubResourceMethods>::ctor(this);
198        this
199    }
200}
201
202#[cfg(feature = "app-hubresource")]
203#[doc(hidden)]
204pub mod prelude {
205    pub use super::{HubResource, IHubResource, IHubResourceMethods};
206    #[cfg(feature = "app-singletonclass_1")]
207    pub use crate::app::singletonclass_1::ISingletonClass_1Methods;
208    #[cfg(feature = "system-object")]
209    pub use crate::system::object::IObjectMethods;
210    pub use crate::{app::singletonclass_1::ISingletonClass_1, system::object::IObject};
211}