Skip to main content

engage/generated/unity_engine/events/
baseinvokablecall.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-events-baseinvokablecall-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::object::{IObject, Object};
9
10    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/events/baseinvokablecall/BaseInvokableCall.md"))]
11    #[::unity::class(namespace = "UnityEngine.Events", name = "BaseInvokableCall")]
12    #[parent(crate::system::object::Object)]
13    pub struct BaseInvokableCall {}
14}
15
16#[cfg(feature = "unity_engine-events-baseinvokablecall-types")]
17pub use __types::*;
18
19#[cfg(feature = "unity_engine-events-baseinvokablecall")]
20impl BaseInvokableCall {
21    pub fn throw_on_invalid_arg<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
22        arg: impl ::core::convert::Into<crate::system::object::Object>,
23    ) -> () {
24        static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
25            ::unity::lookup::method_info_on_class(<BaseInvokableCall as ::unity::ClassIdentity>::class(), "ThrowOnInvalidArg", 1)
26        });
27        #[allow(clippy::type_complexity)]
28        static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
29            ::std::sync::OnceLock::new();
30        let _ = true;
31        let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
32            ::core::result::Result::Ok(mi) => *mi,
33            ::core::result::Result::Err(e) => {
34                panic!(
35                    "method lookup failed: {}
36::{}
37: {}
38",
39                    <BaseInvokableCall as ::unity::ClassIdentity>::NAME,
40                    "ThrowOnInvalidArg",
41                    e
42                )
43            },
44        };
45        let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
46        let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
47        let __inflated: &'static ::unity::il2cpp::MethodInfo = {
48            let mut __guard = __cache.lock().unwrap();
49            *__guard
50                .entry(__key)
51                .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
52        };
53        unsafe {
54            let __f: extern "C" fn(crate::system::object::Object, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__inflated.method_ptr);
55            let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
56            __f(::core::convert::Into::into(arg), ::core::option::Option::Some(__mi_opaque))
57        }
58    }
59
60    #[doc = "`AllowInvoke(crate::system::delegate::Delegate)` overload"]
61    pub fn allow_invoke(delegate: impl ::core::convert::Into<crate::system::delegate::Delegate>) -> bool {
62        unsafe {
63            ::unity::il2cpp_call!((::unity::module_base()+0x2c371d0usize)as*mut u8,bool;
64(crate::system::delegate::Delegate)::core::convert::Into::into(delegate))
65        }
66    }
67}
68
69#[cfg(feature = "unity_engine-events-baseinvokablecall")]
70pub trait IBaseInvokableCallMethods: IBaseInvokableCall {
71    #[doc = "`.ctor()` overload"]
72    fn ctor(self) -> () {
73        unsafe {
74            let __receiver = <BaseInvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
75            ::unity::il2cpp_call!((::unity::module_base()+0x2c370e0usize)as*mut u8,();
76(BaseInvokableCall)__receiver)
77        }
78    }
79    #[doc = "`.ctor(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
80    fn ctor_2(
81        self,
82        target: impl ::core::convert::Into<crate::system::object::Object>,
83        function: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
84    ) -> () {
85        unsafe {
86            let __receiver = <BaseInvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
87            ::unity::il2cpp_call!((::unity::module_base()+0x2c370f0usize)as*mut u8,();
88(BaseInvokableCall)__receiver,(crate::system::object::Object)::core::convert::Into::into(target),(crate::system::reflection::methodinfo::MethodInfo)::core::convert::Into::into(function))
89        }
90    }
91    #[doc = "`Invoke(::unity::Array<crate::system::object::Object>)` overload"]
92    fn invoke(self, args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>) -> () {
93        unsafe {
94            let __receiver = <BaseInvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
95            {
96                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
97                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
98                    panic!(
99                        "unity: virtual slot {}
100 out of range (vtable len {}
101) on the runtime class behind {}
102 (method `{}
103`)",
104                        4usize,
105                        __vt.len(),
106                        <BaseInvokableCall as ::unity::ClassIdentity>::NAME,
107                        "Invoke",
108                    )
109                });
110                let __inner: extern "C" fn(BaseInvokableCall, ::unity::Array<crate::system::object::Object>, ::unity::OptionalMethod) -> () =
111                    ::core::mem::transmute(__vi.method_ptr);
112                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
113                __inner(__receiver, ::core::convert::Into::into(args), __mi)
114            }
115        }
116    }
117    #[doc = "`Find(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
118    fn find(
119        self,
120        target_obj: impl ::core::convert::Into<crate::system::object::Object>,
121        method: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
122    ) -> bool {
123        unsafe {
124            let __receiver = <BaseInvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
125            {
126                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
127                let __vi = *__vt.get(5usize).unwrap_or_else(|| {
128                    panic!(
129                        "unity: virtual slot {}
130 out of range (vtable len {}
131) on the runtime class behind {}
132 (method `{}
133`)",
134                        5usize,
135                        __vt.len(),
136                        <BaseInvokableCall as ::unity::ClassIdentity>::NAME,
137                        "Find",
138                    )
139                });
140                let __inner: extern "C" fn(
141                    BaseInvokableCall,
142                    crate::system::object::Object,
143                    crate::system::reflection::methodinfo::MethodInfo,
144                    ::unity::OptionalMethod,
145                ) -> bool = ::core::mem::transmute(__vi.method_ptr);
146                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
147                __inner(
148                    __receiver,
149                    ::core::convert::Into::into(target_obj),
150                    ::core::convert::Into::into(method),
151                    __mi,
152                )
153            }
154        }
155    }
156}
157
158#[cfg(feature = "unity_engine-events-baseinvokablecall")]
159impl<__T: IBaseInvokableCall> IBaseInvokableCallMethods for __T {}
160
161#[cfg(feature = "unity_engine-events-baseinvokablecall")]
162impl BaseInvokableCall {
163    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
164        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
165    }
166
167    pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
168        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
169    }
170
171    pub fn invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
172        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
173    }
174
175    pub fn allow_invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
176        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
177    }
178
179    pub fn find_method_info() -> &'static ::unity::il2cpp::MethodInfo {
180        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
181    }
182}
183
184#[cfg(feature = "unity_engine-events-baseinvokablecall")]
185impl BaseInvokableCall {
186    #[doc = "Direct (non-virtual) call to `BaseInvokableCall`'s own `Invoke`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
187    pub unsafe fn invoke(this: impl ::core::convert::Into<::unity::IlInstance>, args: ::unity::Array<crate::system::object::Object>) -> () {
188        let __mi = Self::invoke_method_info();
189        let __inner: extern "C" fn(::unity::IlInstance, ::unity::Array<crate::system::object::Object>, ::unity::OptionalMethod) -> () =
190            ::core::mem::transmute(__mi.method_ptr);
191        __inner(this.into(), args, ::core::option::Option::None)
192    }
193
194    #[doc = "Direct (non-virtual) call to `BaseInvokableCall`'s own `Find`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
195    pub unsafe fn find(
196        this: impl ::core::convert::Into<::unity::IlInstance>,
197        target_obj: crate::system::object::Object,
198        method: crate::system::reflection::methodinfo::MethodInfo,
199    ) -> bool {
200        let __mi = Self::find_method_info();
201        let __inner: extern "C" fn(
202            ::unity::IlInstance,
203            crate::system::object::Object,
204            crate::system::reflection::methodinfo::MethodInfo,
205            ::unity::OptionalMethod,
206        ) -> bool = ::core::mem::transmute(__mi.method_ptr);
207        __inner(this.into(), target_obj, method, ::core::option::Option::None)
208    }
209}
210
211#[cfg(feature = "unity_engine-events-baseinvokablecall")]
212impl BaseInvokableCall {
213    #[doc = "`.ctor()` — no args"]
214    pub fn new() -> Self {
215        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
216            panic!(
217                "{}
218::{}
219 failed to instantiate",
220                ::core::stringify!(BaseInvokableCall),
221                ::core::stringify!(new),
222            )
223        });
224        <Self as IBaseInvokableCallMethods>::ctor(this);
225        this
226    }
227
228    #[doc = "`.ctor(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` — overload selector"]
229    pub fn new_2(target: crate::system::object::Object, function: crate::system::reflection::methodinfo::MethodInfo) -> Self {
230        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
231            panic!(
232                "{}
233::{}
234 failed to instantiate",
235                ::core::stringify!(BaseInvokableCall),
236                ::core::stringify!(new_2),
237            )
238        });
239        <Self as IBaseInvokableCallMethods>::ctor_2(this, target, function);
240        this
241    }
242}
243
244#[cfg(feature = "unity_engine-events-baseinvokablecall")]
245#[doc(hidden)]
246pub mod prelude {
247    pub use super::{BaseInvokableCall, IBaseInvokableCall, IBaseInvokableCallMethods};
248    pub use crate::system::object::IObject;
249    #[cfg(feature = "system-object")]
250    pub use crate::system::object::IObjectMethods;
251}