engage/generated/system/collections/
comparer.rs1#[cfg(feature = "system-collections-comparer-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/system/collections/comparer/Comparer.md"))]
11 #[::unity::class(namespace = "System.Collections", name = "Comparer")]
12 #[parent(crate::system::object::Object)]
13 pub struct Comparer {
14 #[static_field]
15 #[rename(name = "Default")]
16 pub default: crate::system::collections::comparer::Comparer,
17 #[static_field]
18 #[rename(name = "DefaultInvariant")]
19 pub default_invariant: crate::system::collections::comparer::Comparer,
20 }
21}
22
23#[cfg(feature = "system-collections-comparer-types")]
24pub use __types::*;
25
26#[cfg(feature = "system-collections-comparer")]
27impl Comparer {
28 #[doc = "`.cctor()` overload"]
29 pub fn cctor() -> () {
30 unsafe {
31 ::unity::il2cpp_call!((::unity::module_base()+0x31ddab0usize)as*mut u8,();
32 )
33 }
34 }
35}
36
37#[cfg(feature = "system-collections-comparer")]
38pub trait IComparerMethods: IComparer {
39 #[doc = "`.ctor()` overload"]
40 fn ctor(self) -> () {
41 unsafe {
42 let __receiver = <Comparer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
43 ::unity::il2cpp_call!((::unity::module_base()+0x31dd560usize)as*mut u8,();
44(Comparer)__receiver)
45 }
46 }
47 #[doc = "`Compare(crate::system::object::Object, crate::system::object::Object)` overload"]
48 fn compare(
49 self,
50 a: impl ::core::convert::Into<crate::system::object::Object>,
51 b: impl ::core::convert::Into<crate::system::object::Object>,
52 ) -> i32 {
53 unsafe {
54 let __receiver = <Comparer as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
55 {
56 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
57 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
58 panic!(
59 "unity: virtual slot {}
60 out of range (vtable len {}
61) on the runtime class behind {}
62 (method `{}
63`)",
64 4usize,
65 __vt.len(),
66 <Comparer as ::unity::ClassIdentity>::NAME,
67 "Compare",
68 )
69 });
70 let __inner: extern "C" fn(Comparer, crate::system::object::Object, crate::system::object::Object, ::unity::OptionalMethod) -> i32 =
71 ::core::mem::transmute(__vi.method_ptr);
72 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
73 __inner(__receiver, ::core::convert::Into::into(a), ::core::convert::Into::into(b), __mi)
74 }
75 }
76 }
77}
78
79#[cfg(feature = "system-collections-comparer")]
80impl<__T: IComparer> IComparerMethods for __T {}
81
82#[cfg(feature = "system-collections-comparer")]
83impl Comparer {
84 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
85 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
86 }
87
88 pub fn compare_method_info() -> &'static ::unity::il2cpp::MethodInfo {
89 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
90 }
91
92 pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
93 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
94 }
95}
96
97#[cfg(feature = "system-collections-comparer")]
98impl Comparer {
99 #[doc = "Direct (non-virtual) call to `Comparer`'s own `Compare`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
100 pub unsafe fn compare(
101 this: impl ::core::convert::Into<::unity::IlInstance>,
102 a: crate::system::object::Object,
103 b: crate::system::object::Object,
104 ) -> i32 {
105 let __mi = Self::compare_method_info();
106 let __inner: extern "C" fn(
107 ::unity::IlInstance,
108 crate::system::object::Object,
109 crate::system::object::Object,
110 ::unity::OptionalMethod,
111 ) -> i32 = ::core::mem::transmute(__mi.method_ptr);
112 __inner(this.into(), a, b, ::core::option::Option::None)
113 }
114}
115
116#[cfg(feature = "system-collections-comparer")]
117impl Comparer {
118 #[doc = "`.ctor()` — no args"]
119 pub fn new() -> Self {
120 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
121 panic!(
122 "{}
123::{}
124 failed to instantiate",
125 ::core::stringify!(Comparer),
126 ::core::stringify!(new),
127 )
128 });
129 <Self as IComparerMethods>::ctor(this);
130 this
131 }
132}
133
134#[cfg(feature = "system-collections-comparer")]
135#[doc(hidden)]
136pub mod prelude {
137 pub use super::{Comparer, IComparer, IComparerMethods};
138 pub use crate::system::object::IObject;
139 #[cfg(feature = "system-object")]
140 pub use crate::system::object::IObjectMethods;
141}