engage/generated/moon_sharp/interpreter/interop/converters/
scripttoclrconversions.rs1#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions-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/moon_sharp/interpreter/interop/converters/scripttoclrconversions/ScriptToClrConversions.md"))]
11 #[::unity::class(namespace = "MoonSharp.Interpreter.Interop.Converters", name = "ScriptToClrConversions")]
12 #[parent(crate::system::object::Object)]
13 pub struct ScriptToClrConversions {
14 #[static_field]
15 #[rename(name = "WEIGHT_MAX_VALUE")]
16 pub weight_max_value: i32,
17 #[static_field]
18 #[rename(name = "WEIGHT_CUSTOM_CONVERTER_MATCH")]
19 pub weight_custom_converter_match: i32,
20 #[static_field]
21 #[rename(name = "WEIGHT_EXACT_MATCH")]
22 pub weight_exact_match: i32,
23 #[static_field]
24 #[rename(name = "WEIGHT_STRING_TO_STRINGBUILDER")]
25 pub weight_string_to_stringbuilder: i32,
26 #[static_field]
27 #[rename(name = "WEIGHT_STRING_TO_CHAR")]
28 pub weight_string_to_char: i32,
29 #[static_field]
30 #[rename(name = "WEIGHT_NIL_TO_NULLABLE")]
31 pub weight_nil_to_nullable: i32,
32 #[static_field]
33 #[rename(name = "WEIGHT_NIL_TO_REFTYPE")]
34 pub weight_nil_to_reftype: i32,
35 #[static_field]
36 #[rename(name = "WEIGHT_VOID_WITH_DEFAULT")]
37 pub weight_void_with_default: i32,
38 #[static_field]
39 #[rename(name = "WEIGHT_VOID_WITHOUT_DEFAULT")]
40 pub weight_void_without_default: i32,
41 #[static_field]
42 #[rename(name = "WEIGHT_NIL_WITH_DEFAULT")]
43 pub weight_nil_with_default: i32,
44 #[static_field]
45 #[rename(name = "WEIGHT_BOOL_TO_STRING")]
46 pub weight_bool_to_string: i32,
47 #[static_field]
48 #[rename(name = "WEIGHT_NUMBER_TO_STRING")]
49 pub weight_number_to_string: i32,
50 #[static_field]
51 #[rename(name = "WEIGHT_NUMBER_TO_ENUM")]
52 pub weight_number_to_enum: i32,
53 #[static_field]
54 #[rename(name = "WEIGHT_USERDATA_TO_STRING")]
55 pub weight_userdata_to_string: i32,
56 #[static_field]
57 #[rename(name = "WEIGHT_TABLE_CONVERSION")]
58 pub weight_table_conversion: i32,
59 #[static_field]
60 #[rename(name = "WEIGHT_NUMBER_DOWNCAST")]
61 pub weight_number_downcast: i32,
62 #[static_field]
63 #[rename(name = "WEIGHT_NO_MATCH")]
64 pub weight_no_match: i32,
65 #[static_field]
66 #[rename(name = "WEIGHT_NO_EXTRA_PARAMS_BONUS")]
67 pub weight_no_extra_params_bonus: i32,
68 #[static_field]
69 #[rename(name = "WEIGHT_EXTRA_PARAMS_MALUS")]
70 pub weight_extra_params_malus: i32,
71 #[static_field]
72 #[rename(name = "WEIGHT_BYREF_BONUSMALUS")]
73 pub weight_byref_bonusmalus: i32,
74 #[static_field]
75 #[rename(name = "WEIGHT_VARARGS_MALUS")]
76 pub weight_varargs_malus: i32,
77 #[static_field]
78 #[rename(name = "WEIGHT_VARARGS_EMPTY")]
79 pub weight_varargs_empty: i32,
80 }
81}
82
83#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions-types")]
84pub use __types::*;
85
86#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions")]
87#[doc(hidden)]
88#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
89mod __ScriptToClrConversions_unity_raw {
90 use super::*;
91 #[doc(hidden)]
92 #[allow(non_snake_case)]
93 pub mod __lookup_dyn_value_to_object {
94 use super::*;
95 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
96 let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
97 &[<crate::moon_sharp::interpreter::dynvalue::DynValue as ::unity::IlType>::il_type()];
98 ::unity::lookup::method_info_on_class_with_signature(
99 <ScriptToClrConversions as ::unity::ClassIdentity>::class(),
100 "DynValueToObject",
101 1,
102 param_types,
103 true,
104 )
105 });
106 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
107 match &*METHOD {
108 ::core::result::Result::Ok(mi) => *mi,
109 ::core::result::Result::Err(e) => {
110 panic!(
111 "method lookup failed: {}
112::{}
113: {}
114",
115 <ScriptToClrConversions as ::unity::ClassIdentity>::NAME,
116 "DynValueToObject",
117 e
118 )
119 },
120 }
121 }
122 }
123 #[doc(hidden)]
124 #[allow(non_snake_case)]
125 pub mod __lookup_dyn_value_to_object_of_type {
126 use super::*;
127 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
128 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
129 <crate::moon_sharp::interpreter::dynvalue::DynValue as ::unity::IlType>::il_type(),
130 <::unity::SystemType as ::unity::IlType>::il_type(),
131 <crate::system::object::Object as ::unity::IlType>::il_type(),
132 <bool as ::unity::IlType>::il_type(),
133 ];
134 ::unity::lookup::method_info_on_class_with_signature(
135 <ScriptToClrConversions as ::unity::ClassIdentity>::class(),
136 "DynValueToObjectOfType",
137 4,
138 param_types,
139 true,
140 )
141 });
142 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
143 match &*METHOD {
144 ::core::result::Result::Ok(mi) => *mi,
145 ::core::result::Result::Err(e) => {
146 panic!(
147 "method lookup failed: {}
148::{}
149: {}
150",
151 <ScriptToClrConversions as ::unity::ClassIdentity>::NAME,
152 "DynValueToObjectOfType",
153 e
154 )
155 },
156 }
157 }
158 }
159 #[doc(hidden)]
160 #[allow(non_snake_case)]
161 pub mod __lookup_dyn_value_to_object_of_type_weight {
162 use super::*;
163 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
164 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
165 <crate::moon_sharp::interpreter::dynvalue::DynValue as ::unity::IlType>::il_type(),
166 <::unity::SystemType as ::unity::IlType>::il_type(),
167 <bool as ::unity::IlType>::il_type(),
168 ];
169 ::unity::lookup::method_info_on_class_with_signature(
170 <ScriptToClrConversions as ::unity::ClassIdentity>::class(),
171 "DynValueToObjectOfTypeWeight",
172 3,
173 param_types,
174 true,
175 )
176 });
177 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
178 match &*METHOD {
179 ::core::result::Result::Ok(mi) => *mi,
180 ::core::result::Result::Err(e) => {
181 panic!(
182 "method lookup failed: {}
183::{}
184: {}
185",
186 <ScriptToClrConversions as ::unity::ClassIdentity>::NAME,
187 "DynValueToObjectOfTypeWeight",
188 e
189 )
190 },
191 }
192 }
193 }
194 #[doc(hidden)]
195 #[allow(non_snake_case)]
196 pub mod __lookup_get_numeric_type_weight {
197 use super::*;
198 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
199 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::SystemType as ::unity::IlType>::il_type()];
200 ::unity::lookup::method_info_on_class_with_signature(
201 <ScriptToClrConversions as ::unity::ClassIdentity>::class(),
202 "GetNumericTypeWeight",
203 1,
204 param_types,
205 true,
206 )
207 });
208 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
209 match &*METHOD {
210 ::core::result::Result::Ok(mi) => *mi,
211 ::core::result::Result::Err(e) => {
212 panic!(
213 "method lookup failed: {}
214::{}
215: {}
216",
217 <ScriptToClrConversions as ::unity::ClassIdentity>::NAME,
218 "GetNumericTypeWeight",
219 e
220 )
221 },
222 }
223 }
224 }
225}
226
227#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions")]
228impl ScriptToClrConversions {
229 #[doc = "`DynValueToObject(crate::moon_sharp::interpreter::dynvalue::DynValue)` overload"]
230 pub fn dyn_value_to_object(
231 value: impl ::core::convert::Into<crate::moon_sharp::interpreter::dynvalue::DynValue>,
232 ) -> crate::system::object::Object {
233 unsafe {
234 ::unity::il2cpp_call!(__ScriptToClrConversions_unity_raw::__lookup_dyn_value_to_object::get_method_info().method_ptr,crate::system::object::Object;
235(crate::moon_sharp::interpreter::dynvalue::DynValue)::core::convert::Into::into(value))
236 }
237 }
238
239 #[doc = "`DynValueToObjectOfType(crate::moon_sharp::interpreter::dynvalue::DynValue, ::unity::SystemType, crate::system::object::Object, bool)` overload"]
240 pub fn dyn_value_to_object_of_type(
241 value: impl ::core::convert::Into<crate::moon_sharp::interpreter::dynvalue::DynValue>,
242 desired_type: impl ::core::convert::Into<::unity::SystemType>,
243 default_value: impl ::core::convert::Into<crate::system::object::Object>,
244 is_optional: impl ::core::convert::Into<bool>,
245 ) -> crate::system::object::Object {
246 unsafe {
247 ::unity::il2cpp_call!(__ScriptToClrConversions_unity_raw::__lookup_dyn_value_to_object_of_type::get_method_info().method_ptr,crate::system::object::Object;
248(crate::moon_sharp::interpreter::dynvalue::DynValue)::core::convert::Into::into(value),(::unity::SystemType)::core::convert::Into::into(desired_type),(crate::system::object::Object)::core::convert::Into::into(default_value),(bool)::core::convert::Into::into(is_optional))
249 }
250 }
251
252 #[doc = "`DynValueToObjectOfTypeWeight(crate::moon_sharp::interpreter::dynvalue::DynValue, ::unity::SystemType, bool)` overload"]
253 pub fn dyn_value_to_object_of_type_weight(
254 value: impl ::core::convert::Into<crate::moon_sharp::interpreter::dynvalue::DynValue>,
255 desired_type: impl ::core::convert::Into<::unity::SystemType>,
256 is_optional: impl ::core::convert::Into<bool>,
257 ) -> i32 {
258 unsafe {
259 ::unity::il2cpp_call!(__ScriptToClrConversions_unity_raw::__lookup_dyn_value_to_object_of_type_weight::get_method_info().method_ptr,i32;
260(crate::moon_sharp::interpreter::dynvalue::DynValue)::core::convert::Into::into(value),(::unity::SystemType)::core::convert::Into::into(desired_type),(bool)::core::convert::Into::into(is_optional))
261 }
262 }
263
264 #[doc = "`GetNumericTypeWeight(::unity::SystemType)` overload"]
265 pub fn get_numeric_type_weight(desired_type: impl ::core::convert::Into<::unity::SystemType>) -> i32 {
266 unsafe {
267 ::unity::il2cpp_call!(__ScriptToClrConversions_unity_raw::__lookup_get_numeric_type_weight::get_method_info().method_ptr,i32;
268(::unity::SystemType)::core::convert::Into::into(desired_type))
269 }
270 }
271}
272
273#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions")]
274impl ScriptToClrConversions {
275 pub fn dyn_value_to_object_method_info() -> &'static ::unity::il2cpp::MethodInfo {
276 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
277 }
278
279 pub fn dyn_value_to_object_of_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
280 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
281 }
282
283 pub fn dyn_value_to_object_of_type_weight_method_info() -> &'static ::unity::il2cpp::MethodInfo {
284 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
285 }
286
287 pub fn get_numeric_type_weight_method_info() -> &'static ::unity::il2cpp::MethodInfo {
288 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
289 }
290}
291
292#[cfg(feature = "moon_sharp-interpreter-interop-converters-scripttoclrconversions")]
293#[doc(hidden)]
294pub mod prelude {
295 pub use super::{IScriptToClrConversions, ScriptToClrConversions};
296 pub use crate::system::object::IObject;
297 #[cfg(feature = "system-object")]
298 pub use crate::system::object::IObjectMethods;
299}