engage/generated/moon_sharp/interpreter/
scriptfunctiondelegate.rs1#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 delegate::{Delegate, IDelegate},
10 multicastdelegate::{IMulticastDelegate, MulticastDelegate},
11 object::{IObject, Object},
12 };
13
14 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/scriptfunctiondelegate/ScriptFunctionDelegate.md"))]
15 #[::unity::class(namespace = "MoonSharp.Interpreter", name = "ScriptFunctionDelegate")]
16 #[parent(crate::system::multicastdelegate::MulticastDelegate)]
17 pub struct ScriptFunctionDelegate {}
18}
19
20#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate-types")]
21pub use __types::*;
22
23#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
24#[doc(hidden)]
25#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
26mod __ScriptFunctionDelegate_unity_raw {
27 use super::*;
28 #[doc(hidden)]
29 #[allow(non_snake_case)]
30 pub mod __lookup_ctor {
31 use super::*;
32 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
33 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
34 <crate::system::object::Object as ::unity::IlType>::il_type(),
35 <::unity::IntPtr as ::unity::IlType>::il_type(),
36 ];
37 ::unity::lookup::method_info_on_class_with_signature(
38 <ScriptFunctionDelegate as ::unity::ClassIdentity>::class(),
39 ".ctor",
40 2,
41 param_types,
42 false,
43 )
44 });
45 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
46 match &*METHOD {
47 ::core::result::Result::Ok(mi) => *mi,
48 ::core::result::Result::Err(e) => {
49 panic!(
50 "method lookup failed: {}
51::{}
52: {}
53",
54 <ScriptFunctionDelegate as ::unity::ClassIdentity>::NAME,
55 ".ctor",
56 e
57 )
58 },
59 }
60 }
61 }
62}
63
64#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
65pub trait IScriptFunctionDelegateMethods: IScriptFunctionDelegate {
66 #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` overload"]
67 fn ctor(self, object: impl ::core::convert::Into<crate::system::object::Object>, method: impl ::core::convert::Into<::unity::IntPtr>) -> () {
68 unsafe {
69 let __receiver =
70 <ScriptFunctionDelegate as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
71 ::unity::il2cpp_call!(__ScriptFunctionDelegate_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
72(ScriptFunctionDelegate)__receiver,(crate::system::object::Object)::core::convert::Into::into(object),(::unity::IntPtr)::core::convert::Into::into(method))
73 }
74 }
75 #[doc = "`Invoke(::unity::Array<crate::system::object::Object>)` overload"]
76 fn invoke(self, args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>) -> crate::system::object::Object {
77 unsafe {
78 let __receiver =
79 <ScriptFunctionDelegate as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
80 {
81 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
82 let __vi = *__vt.get(13usize).unwrap_or_else(|| {
83 panic!(
84 "unity: virtual slot {}
85 out of range (vtable len {}
86) on the runtime class behind {}
87 (method `{}
88`)",
89 13usize,
90 __vt.len(),
91 <ScriptFunctionDelegate as ::unity::ClassIdentity>::NAME,
92 "Invoke",
93 )
94 });
95 let __inner: extern "C" fn(
96 ScriptFunctionDelegate,
97 ::unity::Array<crate::system::object::Object>,
98 ::unity::OptionalMethod,
99 ) -> crate::system::object::Object = ::core::mem::transmute(__vi.method_ptr);
100 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
101 __inner(__receiver, ::core::convert::Into::into(args), __mi)
102 }
103 }
104 }
105}
106
107#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
108impl<__T: IScriptFunctionDelegate> IScriptFunctionDelegateMethods for __T {}
109
110#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
111impl ScriptFunctionDelegate {
112 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
113 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
114 }
115
116 pub fn invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
117 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
118 }
119}
120
121#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
122impl ScriptFunctionDelegate {
123 #[doc = "Direct (non-virtual) call to `ScriptFunctionDelegate`'s own `Invoke`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
124 pub unsafe fn invoke(
125 this: impl ::core::convert::Into<::unity::IlInstance>,
126 args: ::unity::Array<crate::system::object::Object>,
127 ) -> crate::system::object::Object {
128 let __mi = Self::invoke_method_info();
129 let __inner: extern "C" fn(
130 ::unity::IlInstance,
131 ::unity::Array<crate::system::object::Object>,
132 ::unity::OptionalMethod,
133 ) -> crate::system::object::Object = ::core::mem::transmute(__mi.method_ptr);
134 __inner(this.into(), args, ::core::option::Option::None)
135 }
136}
137
138#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
139impl ScriptFunctionDelegate {
140 #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` — overload selector"]
141 pub fn new(object: crate::system::object::Object, method: ::unity::IntPtr) -> Self {
142 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
143 panic!(
144 "{}
145::{}
146 failed to instantiate",
147 ::core::stringify!(ScriptFunctionDelegate),
148 ::core::stringify!(new),
149 )
150 });
151 <Self as IScriptFunctionDelegateMethods>::ctor(this, object, method);
152 this
153 }
154}
155
156#[cfg(feature = "moon_sharp-interpreter-scriptfunctiondelegate")]
157#[doc(hidden)]
158pub mod prelude {
159 pub use super::{IScriptFunctionDelegate, IScriptFunctionDelegateMethods, ScriptFunctionDelegate};
160 #[cfg(feature = "system-delegate")]
161 pub use crate::system::delegate::IDelegateMethods;
162 #[cfg(feature = "system-multicastdelegate")]
163 pub use crate::system::multicastdelegate::IMulticastDelegateMethods;
164 #[cfg(feature = "system-object")]
165 pub use crate::system::object::IObjectMethods;
166 pub use crate::system::{delegate::IDelegate, multicastdelegate::IMulticastDelegate, object::IObject};
167}