Skip to main content

engage/generated/moon_sharp/interpreter/interop/converters/
numericconversions.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions-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/numericconversions/NumericConversions.md"))]
11    #[::unity::class(namespace = "MoonSharp.Interpreter.Interop.Converters", name = "NumericConversions")]
12    #[parent(crate::system::object::Object)]
13    pub struct NumericConversions {
14        #[static_field]
15        #[rename(name = "NumericTypes")]
16        pub numeric_types: crate::system::collections::generic::hashset_1::HashSet_1<::unity::SystemType>,
17        #[static_field]
18        #[rename(name = "NumericTypesOrdered")]
19        pub numeric_types_ordered: ::unity::Array<::unity::SystemType>,
20    }
21}
22
23#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions-types")]
24pub use __types::*;
25
26#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions")]
27#[doc(hidden)]
28#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
29mod __NumericConversions_unity_raw {
30    use super::*;
31    #[doc(hidden)]
32    #[allow(non_snake_case)]
33    pub mod __lookup_cctor {
34        use super::*;
35        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
36            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
37            ::unity::lookup::method_info_on_class_with_signature(
38                <NumericConversions as ::unity::ClassIdentity>::class(),
39                ".cctor",
40                0,
41                param_types,
42                true,
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                        <NumericConversions as ::unity::ClassIdentity>::NAME,
55                        ".cctor",
56                        e
57                    )
58                },
59            }
60        }
61    }
62    #[doc(hidden)]
63    #[allow(non_snake_case)]
64    pub mod __lookup_double_to_type {
65        use super::*;
66        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
67            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
68                &[<::unity::SystemType as ::unity::IlType>::il_type(), <f64 as ::unity::IlType>::il_type()];
69            ::unity::lookup::method_info_on_class_with_signature(
70                <NumericConversions as ::unity::ClassIdentity>::class(),
71                "DoubleToType",
72                2,
73                param_types,
74                true,
75            )
76        });
77        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
78            match &*METHOD {
79                ::core::result::Result::Ok(mi) => *mi,
80                ::core::result::Result::Err(e) => {
81                    panic!(
82                        "method lookup failed: {}
83::{}
84: {}
85",
86                        <NumericConversions as ::unity::ClassIdentity>::NAME,
87                        "DoubleToType",
88                        e
89                    )
90                },
91            }
92        }
93    }
94    #[doc(hidden)]
95    #[allow(non_snake_case)]
96    pub mod __lookup_type_to_double {
97        use super::*;
98        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
99            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[
100                <::unity::SystemType as ::unity::IlType>::il_type(),
101                <crate::system::object::Object as ::unity::IlType>::il_type(),
102            ];
103            ::unity::lookup::method_info_on_class_with_signature(
104                <NumericConversions as ::unity::ClassIdentity>::class(),
105                "TypeToDouble",
106                2,
107                param_types,
108                true,
109            )
110        });
111        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
112            match &*METHOD {
113                ::core::result::Result::Ok(mi) => *mi,
114                ::core::result::Result::Err(e) => {
115                    panic!(
116                        "method lookup failed: {}
117::{}
118: {}
119",
120                        <NumericConversions as ::unity::ClassIdentity>::NAME,
121                        "TypeToDouble",
122                        e
123                    )
124                },
125            }
126        }
127    }
128}
129
130#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions")]
131impl NumericConversions {
132    #[doc = "`.cctor()` overload"]
133    pub fn cctor() -> () {
134        unsafe {
135            ::unity::il2cpp_call!(__NumericConversions_unity_raw::__lookup_cctor::get_method_info().method_ptr,();
136            )
137        }
138    }
139
140    #[doc = "`DoubleToType(::unity::SystemType, f64)` overload"]
141    pub fn double_to_type(
142        r#type: impl ::core::convert::Into<::unity::SystemType>,
143        d: impl ::core::convert::Into<f64>,
144    ) -> crate::system::object::Object {
145        unsafe {
146            ::unity::il2cpp_call!(__NumericConversions_unity_raw::__lookup_double_to_type::get_method_info().method_ptr,crate::system::object::Object;
147(::unity::SystemType)::core::convert::Into::into(r#type),(f64)::core::convert::Into::into(d))
148        }
149    }
150
151    #[doc = "`TypeToDouble(::unity::SystemType, crate::system::object::Object)` overload"]
152    pub fn type_to_double(
153        r#type: impl ::core::convert::Into<::unity::SystemType>,
154        d: impl ::core::convert::Into<crate::system::object::Object>,
155    ) -> f64 {
156        unsafe {
157            ::unity::il2cpp_call!(__NumericConversions_unity_raw::__lookup_type_to_double::get_method_info().method_ptr,f64;
158(::unity::SystemType)::core::convert::Into::into(r#type),(crate::system::object::Object)::core::convert::Into::into(d))
159        }
160    }
161}
162
163#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions")]
164impl NumericConversions {
165    pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
166        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
167    }
168
169    pub fn double_to_type_method_info() -> &'static ::unity::il2cpp::MethodInfo {
170        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
171    }
172
173    pub fn type_to_double_method_info() -> &'static ::unity::il2cpp::MethodInfo {
174        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
175    }
176}
177
178#[cfg(feature = "moon_sharp-interpreter-interop-converters-numericconversions")]
179#[doc(hidden)]
180pub mod prelude {
181    pub use super::{INumericConversions, NumericConversions};
182    pub use crate::system::object::IObject;
183    #[cfg(feature = "system-object")]
184    pub use crate::system::object::IObjectMethods;
185}