1#[cfg(feature = "app-capability-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 app::{
10 capabilitybase_1::{CapabilityBase_1, ICapabilityBase_1},
11 capabilitydefinition::{CapabilityDefinition, ICapabilityDefinition},
12 },
13 system::object::{IObject, Object},
14 };
15
16 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/app/capability/Capability.md"))]
17 #[::unity::class(namespace = "App", name = "Capability")]
18 #[parent(crate::app::capabilitybase_1::CapabilityBase_1<u8>)]
19 pub struct Capability {
20 #[static_field]
21 #[rename(name = "Min")]
22 pub min: i32,
23 #[static_field]
24 #[rename(name = "Max")]
25 pub max: i32,
26 }
27}
28
29#[cfg(feature = "app-capability-types")]
30pub use __types::*;
31
32#[cfg(feature = "app-capability")]
33pub trait ICapabilityMethods: ICapability {
34 #[doc = "`.ctor(u8)` overload"]
35 fn ctor(self, value: impl ::core::convert::Into<u8>) -> () {
36 unsafe {
37 let __receiver = <Capability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
38 ::unity::il2cpp_call!((::unity::module_base()+0x25bcca0usize)as*mut u8,();
39(Capability)__receiver,(u8)::core::convert::Into::into(value))
40 }
41 }
42 #[doc = "`Add(i32, u8)` overload"]
43 fn add(self, i: impl ::core::convert::Into<i32>, v: impl ::core::convert::Into<u8>) -> () {
44 unsafe {
45 let __receiver = <Capability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
46 {
47 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
48 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
49 panic!(
50 "unity: virtual slot {}
51 out of range (vtable len {}
52) on the runtime class behind {}
53 (method `{}
54`)",
55 5usize,
56 __vt.len(),
57 <Capability as ::unity::ClassIdentity>::NAME,
58 "Add",
59 )
60 });
61 let __inner: extern "C" fn(Capability, i32, u8, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
62 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
63 __inner(__receiver, ::core::convert::Into::into(i), ::core::convert::Into::into(v), __mi)
64 }
65 }
66 }
67 #[doc = "`IsZero()` overload"]
68 fn is_zero(self) -> bool {
69 unsafe {
70 let __receiver = <Capability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
71 {
72 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
73 let __vi = *__vt.get(6usize).unwrap_or_else(|| {
74 panic!(
75 "unity: virtual slot {}
76 out of range (vtable len {}
77) on the runtime class behind {}
78 (method `{}
79`)",
80 6usize,
81 __vt.len(),
82 <Capability as ::unity::ClassIdentity>::NAME,
83 "IsZero",
84 )
85 });
86 let __inner: extern "C" fn(Capability, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__vi.method_ptr);
87 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
88 __inner(__receiver, __mi)
89 }
90 }
91 }
92 #[doc = "`WriteToStream(crate::app::stream_2::Stream_2, u8)` overload"]
93 fn write_to_stream(self, stream: impl ::core::convert::Into<crate::app::stream_2::Stream_2>, v: impl ::core::convert::Into<u8>) -> () {
94 unsafe {
95 let __receiver = <Capability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
96 {
97 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
98 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
99 panic!(
100 "unity: virtual slot {}
101 out of range (vtable len {}
102) on the runtime class behind {}
103 (method `{}
104`)",
105 7usize,
106 __vt.len(),
107 <Capability as ::unity::ClassIdentity>::NAME,
108 "WriteToStream",
109 )
110 });
111 let __inner: extern "C" fn(Capability, crate::app::stream_2::Stream_2, u8, ::unity::OptionalMethod) -> () =
112 ::core::mem::transmute(__vi.method_ptr);
113 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
114 __inner(__receiver, ::core::convert::Into::into(stream), ::core::convert::Into::into(v), __mi)
115 }
116 }
117 }
118 #[doc = "`ReadFromStream(crate::app::stream_2::Stream_2)` overload"]
119 fn read_from_stream(self, stream: impl ::core::convert::Into<crate::app::stream_2::Stream_2>) -> u8 {
120 unsafe {
121 let __receiver = <Capability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
122 {
123 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
124 let __vi = *__vt.get(8usize).unwrap_or_else(|| {
125 panic!(
126 "unity: virtual slot {}
127 out of range (vtable len {}
128) on the runtime class behind {}
129 (method `{}
130`)",
131 8usize,
132 __vt.len(),
133 <Capability as ::unity::ClassIdentity>::NAME,
134 "ReadFromStream",
135 )
136 });
137 let __inner: extern "C" fn(Capability, crate::app::stream_2::Stream_2, ::unity::OptionalMethod) -> u8 =
138 ::core::mem::transmute(__vi.method_ptr);
139 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
140 __inner(__receiver, ::core::convert::Into::into(stream), __mi)
141 }
142 }
143 }
144}
145
146#[cfg(feature = "app-capability")]
147impl<__T: ICapability> ICapabilityMethods for __T {}
148
149#[cfg(feature = "app-capability")]
150impl Capability {
151 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
152 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
153 }
154
155 pub fn add_method_info() -> &'static ::unity::il2cpp::MethodInfo {
156 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
157 }
158
159 pub fn is_zero_method_info() -> &'static ::unity::il2cpp::MethodInfo {
160 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
161 }
162
163 pub fn write_to_stream_method_info() -> &'static ::unity::il2cpp::MethodInfo {
164 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
165 }
166
167 pub fn read_from_stream_method_info() -> &'static ::unity::il2cpp::MethodInfo {
168 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
169 }
170}
171
172#[cfg(feature = "app-capability")]
173impl Capability {
174 #[doc = "Direct (non-virtual) call to `Capability`'s own `Add`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
175 pub unsafe fn add(this: impl ::core::convert::Into<::unity::IlInstance>, i: i32, v: u8) -> () {
176 let __mi = Self::add_method_info();
177 let __inner: extern "C" fn(::unity::IlInstance, i32, u8, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
178 __inner(this.into(), i, v, ::core::option::Option::None)
179 }
180
181 #[doc = "Direct (non-virtual) call to `Capability`'s own `IsZero`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
182 pub unsafe fn is_zero(this: impl ::core::convert::Into<::unity::IlInstance>) -> bool {
183 let __mi = Self::is_zero_method_info();
184 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__mi.method_ptr);
185 __inner(this.into(), ::core::option::Option::None)
186 }
187
188 #[doc = "Direct (non-virtual) call to `Capability`'s own `WriteToStream`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
189 pub unsafe fn write_to_stream(this: impl ::core::convert::Into<::unity::IlInstance>, stream: crate::app::stream_2::Stream_2, v: u8) -> () {
190 let __mi = Self::write_to_stream_method_info();
191 let __inner: extern "C" fn(::unity::IlInstance, crate::app::stream_2::Stream_2, u8, ::unity::OptionalMethod) -> () =
192 ::core::mem::transmute(__mi.method_ptr);
193 __inner(this.into(), stream, v, ::core::option::Option::None)
194 }
195
196 #[doc = "Direct (non-virtual) call to `Capability`'s own `ReadFromStream`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
197 pub unsafe fn read_from_stream(this: impl ::core::convert::Into<::unity::IlInstance>, stream: crate::app::stream_2::Stream_2) -> u8 {
198 let __mi = Self::read_from_stream_method_info();
199 let __inner: extern "C" fn(::unity::IlInstance, crate::app::stream_2::Stream_2, ::unity::OptionalMethod) -> u8 =
200 ::core::mem::transmute(__mi.method_ptr);
201 __inner(this.into(), stream, ::core::option::Option::None)
202 }
203}
204
205#[cfg(feature = "app-capability")]
206impl Capability {
207 #[doc = "`.ctor(u8)` — overload selector"]
208 pub fn new(value: u8) -> Self {
209 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
210 panic!(
211 "{}
212::{}
213 failed to instantiate",
214 ::core::stringify!(Capability),
215 ::core::stringify!(new),
216 )
217 });
218 <Self as ICapabilityMethods>::ctor(this, value);
219 this
220 }
221}
222
223#[cfg(feature = "app-capability")]
224#[doc(hidden)]
225pub mod prelude {
226 pub use super::{Capability, ICapability, ICapabilityMethods};
227 #[cfg(feature = "app-capabilitybase_1")]
228 pub use crate::app::capabilitybase_1::ICapabilityBase_1Methods;
229 #[cfg(feature = "app-capabilitydefinition")]
230 pub use crate::app::capabilitydefinition::ICapabilityDefinitionMethods;
231 #[cfg(feature = "system-object")]
232 pub use crate::system::object::IObjectMethods;
233 pub use crate::{
234 app::{capabilitybase_1::ICapabilityBase_1, capabilitydefinition::ICapabilityDefinition},
235 system::object::IObject,
236 };
237}