engage/generated/system/
int32.rs1#[cfg(feature = "system-int32-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::{
9 object::{IObject, Object},
10 valuetype::{IValueType, ValueType},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/system/int32/Int32.md"))]
14 #[repr(C)]
15 #[derive(::core::clone::Clone, ::core::marker::Copy)]
16 pub struct Int32 {
17 pub m_value: i32,
18 }
19 impl ::unity::ClassIdentity for Int32 {
20 const NAME: &'static str = "Int32";
21 const NAMESPACE: &'static str = "System";
22
23 fn class() -> ::unity::Class {
24 static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
25 *CACHE.get_or_init(|| ::unity::Class::lookup(Self::NAMESPACE, Self::NAME))
26 }
27 }
28 impl ::unity::IlType for Int32 {
29 fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
30 &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
31 }
32 }
33 impl Int32 {
34 #[inline]
35 pub fn max_value() -> i32 {
36 static OFFSET: ::std::sync::OnceLock<usize> = ::std::sync::OnceLock::new();
37 let __offset = ::unity::cached_field_offset_static::<Self>(&OFFSET, "MaxValue");
38 ::unity::static_field_get_value_at_offset(<Self as ::unity::ClassIdentity>::class(), __offset)
39 }
40
41 #[inline]
42 pub fn set_max_value(value: i32) {
43 static OFFSET: ::std::sync::OnceLock<usize> = ::std::sync::OnceLock::new();
44 let __offset = ::unity::cached_field_offset_static::<Self>(&OFFSET, "MaxValue");
45 ::unity::static_field_set_value_at_offset(<Self as ::unity::ClassIdentity>::class(), __offset, value);
46 }
47
48 #[inline]
49 pub fn min_value() -> i32 {
50 static OFFSET: ::std::sync::OnceLock<usize> = ::std::sync::OnceLock::new();
51 let __offset = ::unity::cached_field_offset_static::<Self>(&OFFSET, "MinValue");
52 ::unity::static_field_get_value_at_offset(<Self as ::unity::ClassIdentity>::class(), __offset)
53 }
54
55 #[inline]
56 pub fn set_min_value(value: i32) {
57 static OFFSET: ::std::sync::OnceLock<usize> = ::std::sync::OnceLock::new();
58 let __offset = ::unity::cached_field_offset_static::<Self>(&OFFSET, "MinValue");
59 ::unity::static_field_set_value_at_offset(<Self as ::unity::ClassIdentity>::class(), __offset, value);
60 }
61 }
62}
63
64#[cfg(feature = "system-int32-types")]
65pub use __types::*;
66
67#[cfg(feature = "system-int32")]
68impl Int32 {
69 #[doc = "`Parse(::unity::Il2CppString)` overload"]
70 pub fn parse(s: impl ::core::convert::Into<::unity::Il2CppString>) -> i32 {
71 unsafe {
72 ::unity::il2cpp_call!((::unity::module_base()+0x3260420usize)as*mut u8,i32;
73(::unity::Il2CppString)::core::convert::Into::into(s))
74 }
75 }
76
77 #[doc = "`TryParse(::unity::Il2CppString, *muti32)` overload"]
78 pub fn try_parse(s: impl ::core::convert::Into<::unity::Il2CppString>) -> (bool, i32) {
79 unsafe {
80 let mut __out_0 = ::core::mem::MaybeUninit::<i32>::uninit();
81 let __ret = {
82 ::unity::il2cpp_call!((::unity::module_base()+0x3260550usize)as*mut u8,bool;
83(::unity::Il2CppString)::core::convert::Into::into(s),(*mut i32)__out_0.as_mut_ptr())
84 };
85 (__ret, __out_0.assume_init())
86 }
87 }
88}
89
90#[cfg(feature = "system-int32")]
91impl Int32 {
92 #[doc = "`CompareTo(crate::system::object::Object)` overload"]
93 pub fn compare_to(&mut self, value: impl ::core::convert::Into<crate::system::object::Object>) -> i32 {
94 unsafe {
95 ::unity::il2cpp_call!((::unity::module_base()+0x3260150usize)as*mut u8,i32;
96(*mut Int32)self as*mut Int32,(crate::system::object::Object)::core::convert::Into::into(value))
97 }
98 }
99
100 #[doc = "`CompareTo(i32)` overload"]
101 pub fn compare_to_2(&mut self, value: impl ::core::convert::Into<i32>) -> i32 {
102 unsafe {
103 ::unity::il2cpp_call!((::unity::module_base()+0x3260250usize)as*mut u8,i32;
104(*mut Int32)self as*mut Int32,(i32)::core::convert::Into::into(value))
105 }
106 }
107
108 #[doc = "`Equals(crate::system::object::Object)` overload"]
109 pub fn equals(&mut self, obj: impl ::core::convert::Into<crate::system::object::Object>) -> bool {
110 unsafe {
111 ::unity::il2cpp_call!((::unity::module_base()+0x3260270usize)as*mut u8,bool;
112(*mut Int32)self as*mut Int32,(crate::system::object::Object)::core::convert::Into::into(obj))
113 }
114 }
115
116 #[doc = "`Equals(i32)` overload"]
117 pub fn equals_2(&mut self, obj: impl ::core::convert::Into<i32>) -> bool {
118 unsafe {
119 ::unity::il2cpp_call!((::unity::module_base()+0x3260300usize)as*mut u8,bool;
120(*mut Int32)self as*mut Int32,(i32)::core::convert::Into::into(obj))
121 }
122 }
123
124 #[doc = "`GetHashCode()` overload"]
125 pub fn get_hash_code(&mut self) -> i32 {
126 unsafe {
127 ::unity::il2cpp_call!((::unity::module_base()+0x3260310usize)as*mut u8,i32;
128(*mut Int32)self as*mut Int32)
129 }
130 }
131
132 #[doc = "`ToString()` overload"]
133 pub fn to_string(&mut self) -> ::unity::Il2CppString {
134 unsafe {
135 ::unity::il2cpp_call!((::unity::module_base()+0x3260320usize)as*mut u8, ::unity::Il2CppString;
136(*mut Int32)self as*mut Int32)
137 }
138 }
139
140 #[doc = "`ToString(::unity::Il2CppString)` overload"]
141 pub fn to_string_2(&mut self, format: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
142 unsafe {
143 ::unity::il2cpp_call!((::unity::module_base()+0x3260360usize)as*mut u8, ::unity::Il2CppString;
144(*mut Int32)self as*mut Int32,(::unity::Il2CppString)::core::convert::Into::into(format))
145 }
146 }
147}
148
149#[cfg(feature = "system-int32")]
150impl Int32 {
151 pub fn compare_to_method_info() -> &'static ::unity::il2cpp::MethodInfo {
152 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
153 }
154
155 pub fn compare_to_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
156 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
157 }
158
159 pub fn equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
160 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
161 }
162
163 pub fn equals_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
164 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
165 }
166
167 pub fn get_hash_code_method_info() -> &'static ::unity::il2cpp::MethodInfo {
168 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
169 }
170
171 pub fn to_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
172 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
173 }
174
175 pub fn to_string_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
176 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
177 }
178
179 pub fn parse_method_info() -> &'static ::unity::il2cpp::MethodInfo {
180 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
181 }
182
183 pub fn try_parse_method_info() -> &'static ::unity::il2cpp::MethodInfo {
184 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
185 }
186}
187
188#[cfg(feature = "system-int32")]
189#[doc(hidden)]
190pub mod prelude {
191 pub use super::Int32;
192 #[cfg(feature = "system-object")]
193 pub use crate::system::object::IObjectMethods;
194 #[cfg(feature = "system-valuetype")]
195 pub use crate::system::valuetype::IValueTypeMethods;
196 pub use crate::system::{object::IObject, valuetype::IValueType};
197}