engage/generated/system/
uint16.rs1#[cfg(feature = "system-uint16-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/uint16/UInt16.md"))]
14 #[repr(C)]
15 #[derive(::core::clone::Clone, ::core::marker::Copy)]
16 pub struct UInt16 {
17 pub m_value: u16,
18 }
19 impl ::unity::ClassIdentity for UInt16 {
20 const NAME: &'static str = "UInt16";
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 UInt16 {
29 fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
30 &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
31 }
32 }
33 impl UInt16 {
34 #[inline]
35 pub fn max_value() -> u16 {
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: u16) {
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() -> u16 {
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: u16) {
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-uint16-types")]
65pub use __types::*;
66
67#[cfg(feature = "system-uint16")]
68impl UInt16 {
69 #[doc = "`Parse(::unity::Il2CppString)` overload"]
70 pub fn parse(s: impl ::core::convert::Into<::unity::Il2CppString>) -> u16 {
71 unsafe {
72 ::unity::il2cpp_call!((::unity::module_base()+0x3567ce0usize)as*mut u8,u16;
73(::unity::Il2CppString)::core::convert::Into::into(s))
74 }
75 }
76}
77
78#[cfg(feature = "system-uint16")]
79impl UInt16 {
80 #[doc = "`CompareTo(crate::system::object::Object)` overload"]
81 pub fn compare_to(&mut self, value: impl ::core::convert::Into<crate::system::object::Object>) -> i32 {
82 unsafe {
83 ::unity::il2cpp_call!((::unity::module_base()+0x3567a80usize)as*mut u8,i32;
84(*mut UInt16)self as*mut UInt16,(crate::system::object::Object)::core::convert::Into::into(value))
85 }
86 }
87
88 #[doc = "`CompareTo(u16)` overload"]
89 pub fn compare_to_2(&mut self, value: impl ::core::convert::Into<u16>) -> i32 {
90 unsafe {
91 ::unity::il2cpp_call!((::unity::module_base()+0x3567b60usize)as*mut u8,i32;
92(*mut UInt16)self as*mut UInt16,(u16)::core::convert::Into::into(value))
93 }
94 }
95
96 #[doc = "`Equals(crate::system::object::Object)` overload"]
97 pub fn equals(&mut self, obj: impl ::core::convert::Into<crate::system::object::Object>) -> bool {
98 unsafe {
99 ::unity::il2cpp_call!((::unity::module_base()+0x3567b70usize)as*mut u8,bool;
100(*mut UInt16)self as*mut UInt16,(crate::system::object::Object)::core::convert::Into::into(obj))
101 }
102 }
103
104 #[doc = "`Equals(u16)` overload"]
105 pub fn equals_2(&mut self, obj: impl ::core::convert::Into<u16>) -> bool {
106 unsafe {
107 ::unity::il2cpp_call!((::unity::module_base()+0x3567c00usize)as*mut u8,bool;
108(*mut UInt16)self as*mut UInt16,(u16)::core::convert::Into::into(obj))
109 }
110 }
111
112 #[doc = "`GetHashCode()` overload"]
113 pub fn get_hash_code(&mut self) -> i32 {
114 unsafe {
115 ::unity::il2cpp_call!((::unity::module_base()+0x3567c10usize)as*mut u8,i32;
116(*mut UInt16)self as*mut UInt16)
117 }
118 }
119
120 #[doc = "`ToString()` overload"]
121 pub fn to_string(&mut self) -> ::unity::Il2CppString {
122 unsafe {
123 ::unity::il2cpp_call!((::unity::module_base()+0x3567c20usize)as*mut u8, ::unity::Il2CppString;
124(*mut UInt16)self as*mut UInt16)
125 }
126 }
127}
128
129#[cfg(feature = "system-uint16")]
130impl UInt16 {
131 pub fn compare_to_method_info() -> &'static ::unity::il2cpp::MethodInfo {
132 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
133 }
134
135 pub fn compare_to_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
136 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
137 }
138
139 pub fn equals_method_info() -> &'static ::unity::il2cpp::MethodInfo {
140 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
141 }
142
143 pub fn equals_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
144 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
145 }
146
147 pub fn get_hash_code_method_info() -> &'static ::unity::il2cpp::MethodInfo {
148 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
149 }
150
151 pub fn to_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
152 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
153 }
154
155 pub fn parse_method_info() -> &'static ::unity::il2cpp::MethodInfo {
156 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
157 }
158}
159
160#[cfg(feature = "system-uint16")]
161#[doc(hidden)]
162pub mod prelude {
163 pub use super::UInt16;
164 #[cfg(feature = "system-object")]
165 pub use crate::system::object::IObjectMethods;
166 #[cfg(feature = "system-valuetype")]
167 pub use crate::system::valuetype::IValueTypeMethods;
168 pub use crate::system::{object::IObject, valuetype::IValueType};
169}