Skip to main content

engage/generated/app/
battlemath.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "app-battlemath-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::{
9        delegate::{Delegate, IDelegate},
10        multicastdelegate::{IMulticastDelegate, MulticastDelegate},
11        object::{IObject, Object},
12    };
13
14    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/app/battlemath/BattleMath.md"))]
15    #[::unity::class(namespace = "App", name = "BattleMath")]
16    #[parent(crate::system::object::Object)]
17    pub struct BattleMath {
18        #[static_field]
19        #[rename(name = "s_CurrentProbability100")]
20        pub s_current_probability100: crate::app::battlemath::BattleMath_Probability,
21        #[static_field]
22        #[rename(name = "s_CurrentProbabilityHit")]
23        pub s_current_probability_hit: crate::app::battlemath::BattleMath_Probability,
24        #[static_field]
25        #[rename(name = "s_Probability100")]
26        pub s_probability100: crate::app::battlemath::BattleMath_Probability,
27        #[static_field]
28        #[rename(name = "s_ProbabilityHit")]
29        pub s_probability_hit: crate::app::battlemath::BattleMath_Probability,
30        #[static_field]
31        #[rename(name = "s_ProbabilityTrue")]
32        pub s_probability_true: crate::app::battlemath::BattleMath_Probability,
33        #[static_field]
34        #[rename(name = "s_ProbabilityFalse")]
35        pub s_probability_false: crate::app::battlemath::BattleMath_Probability,
36        #[static_field]
37        #[rename(name = "s_RandomSeed")]
38        pub s_random_seed: crate::system::collections::generic::stack_1::Stack_1<crate::app::randomseed::RandomSeed>,
39        #[static_field]
40        #[rename(name = "s_Simulationed")]
41        pub s_simulationed: i32,
42    }
43
44    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/app/battlemath/BattleMath_Probability.md"))]
45    #[::unity::class(namespace = "App", name = "BattleMath.Probability")]
46    #[parent(crate::system::multicastdelegate::MulticastDelegate)]
47    pub struct BattleMath_Probability {}
48}
49
50#[cfg(feature = "app-battlemath-types")]
51pub use __types::*;
52
53#[cfg(feature = "app-battlemath")]
54impl BattleMath {
55    #[doc = "`_IsProbability100(i32)` overload"]
56    pub fn is_probability100(ratio: impl ::core::convert::Into<i32>) -> bool {
57        unsafe {
58            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d0b0usize)as*mut u8,bool;
59(i32)::core::convert::Into::into(ratio))
60        }
61    }
62
63    #[doc = "`_IsProbabilityHit(i32)` overload"]
64    pub fn is_probability_hit(ratio: impl ::core::convert::Into<i32>) -> bool {
65        unsafe {
66            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d0e0usize)as*mut u8,bool;
67(i32)::core::convert::Into::into(ratio))
68        }
69    }
70
71    #[doc = "`_IsProbabilityTrue(i32)` overload"]
72    pub fn is_probability_true(ratio: impl ::core::convert::Into<i32>) -> bool {
73        unsafe {
74            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d2c0usize)as*mut u8,bool;
75(i32)::core::convert::Into::into(ratio))
76        }
77    }
78
79    #[doc = "`_IsProbabilityFalse(i32)` overload"]
80    pub fn is_probability_false(ratio: impl ::core::convert::Into<i32>) -> bool {
81        unsafe {
82            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d2d0usize)as*mut u8,bool;
83(i32)::core::convert::Into::into(ratio))
84        }
85    }
86
87    #[doc = "`SetSimulation(bool)` overload"]
88    pub fn set_simulation(enable: impl ::core::convert::Into<bool>) -> () {
89        unsafe {
90            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d2e0usize)as*mut u8,();
91(bool)::core::convert::Into::into(enable))
92        }
93    }
94
95    #[doc = "`RandomCheck100(i32)` overload"]
96    pub fn random_check100(percent: impl ::core::convert::Into<i32>) -> bool {
97        unsafe {
98            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d3a0usize)as*mut u8,bool;
99(i32)::core::convert::Into::into(percent))
100        }
101    }
102
103    #[doc = "`PushRandomSeed()` overload"]
104    pub fn push_random_seed() -> () {
105        unsafe {
106            ::unity::il2cpp_call!((::unity::module_base()+0x1e7e400usize)as*mut u8,();
107            )
108        }
109    }
110
111    #[doc = "`PopRandomSeed()` overload"]
112    pub fn pop_random_seed() -> () {
113        unsafe {
114            ::unity::il2cpp_call!((::unity::module_base()+0x1e7eff0usize)as*mut u8,();
115            )
116        }
117    }
118
119    #[doc = "`PushSimulation()` overload"]
120    pub fn push_simulation() -> () {
121        unsafe {
122            ::unity::il2cpp_call!((::unity::module_base()+0x1e7e490usize)as*mut u8,();
123            )
124        }
125    }
126
127    #[doc = "`PopSimulation()` overload"]
128    pub fn pop_simulation() -> () {
129        unsafe {
130            ::unity::il2cpp_call!((::unity::module_base()+0x1e7f090usize)as*mut u8,();
131            )
132        }
133    }
134
135    #[doc = "`RandomCheckHit(i32)` overload"]
136    pub fn random_check_hit(ratio: impl ::core::convert::Into<i32>) -> bool {
137        unsafe {
138            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d420usize)as*mut u8,bool;
139(i32)::core::convert::Into::into(ratio))
140        }
141    }
142
143    #[doc = "`GetHitRatio10000(i32)` overload"]
144    pub fn get_hit_ratio10000(ratio: impl ::core::convert::Into<i32>) -> i32 {
145        unsafe {
146            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d200usize)as*mut u8,i32;
147(i32)::core::convert::Into::into(ratio))
148        }
149    }
150
151    #[doc = "`GetHitRealRatio(i32)` overload"]
152    pub fn get_hit_real_ratio(ratio: impl ::core::convert::Into<i32>) -> f32 {
153        unsafe {
154            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d4a0usize)as*mut u8,f32;
155(i32)::core::convert::Into::into(ratio))
156        }
157    }
158
159    #[doc = "`GetRandom(i32)` overload"]
160    pub fn get_random(num: impl ::core::convert::Into<i32>) -> i32 {
161        unsafe {
162            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d5b0usize)as*mut u8,i32;
163(i32)::core::convert::Into::into(num))
164        }
165    }
166
167    #[doc = "`GetRandom(i32, i32)` overload"]
168    pub fn get_random_2(min: impl ::core::convert::Into<i32>, max: impl ::core::convert::Into<i32>) -> i32 {
169        unsafe {
170            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d5e0usize)as*mut u8,i32;
171(i32)::core::convert::Into::into(min),(i32)::core::convert::Into::into(max))
172        }
173    }
174
175    #[doc = "`.cctor()` overload"]
176    pub fn cctor() -> () {
177        unsafe {
178            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d630usize)as*mut u8,();
179            )
180        }
181    }
182}
183
184#[cfg(feature = "app-battlemath")]
185pub trait IBattleMathMethods: IBattleMath {
186    #[doc = "`.ctor()` overload"]
187    fn ctor(self) -> () {
188        unsafe {
189            let __receiver = <BattleMath as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
190            ::unity::il2cpp_call!((::unity::module_base()+0x1e8d620usize)as*mut u8,();
191(BattleMath)__receiver)
192        }
193    }
194}
195
196#[cfg(feature = "app-battlemath")]
197impl<__T: IBattleMath> IBattleMathMethods for __T {}
198
199#[cfg(feature = "app-battlemath")]
200impl BattleMath {
201    pub fn is_probability100_method_info() -> &'static ::unity::il2cpp::MethodInfo {
202        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
203    }
204
205    pub fn is_probability_hit_method_info() -> &'static ::unity::il2cpp::MethodInfo {
206        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
207    }
208
209    pub fn is_probability_true_method_info() -> &'static ::unity::il2cpp::MethodInfo {
210        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
211    }
212
213    pub fn is_probability_false_method_info() -> &'static ::unity::il2cpp::MethodInfo {
214        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
215    }
216
217    pub fn set_simulation_method_info() -> &'static ::unity::il2cpp::MethodInfo {
218        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
219    }
220
221    pub fn random_check100_method_info() -> &'static ::unity::il2cpp::MethodInfo {
222        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
223    }
224
225    pub fn push_random_seed_method_info() -> &'static ::unity::il2cpp::MethodInfo {
226        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
227    }
228
229    pub fn pop_random_seed_method_info() -> &'static ::unity::il2cpp::MethodInfo {
230        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
231    }
232
233    pub fn push_simulation_method_info() -> &'static ::unity::il2cpp::MethodInfo {
234        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
235    }
236
237    pub fn pop_simulation_method_info() -> &'static ::unity::il2cpp::MethodInfo {
238        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
239    }
240
241    pub fn random_check_hit_method_info() -> &'static ::unity::il2cpp::MethodInfo {
242        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
243    }
244
245    pub fn get_hit_ratio10000_method_info() -> &'static ::unity::il2cpp::MethodInfo {
246        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
247    }
248
249    pub fn get_hit_real_ratio_method_info() -> &'static ::unity::il2cpp::MethodInfo {
250        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
251    }
252
253    pub fn get_random_method_info() -> &'static ::unity::il2cpp::MethodInfo {
254        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
255    }
256
257    pub fn get_random_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
258        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
259    }
260
261    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
262        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
263    }
264
265    pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
266        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
267    }
268}
269
270#[cfg(feature = "app-battlemath")]
271impl BattleMath {
272    #[doc = "`.ctor()` — no args"]
273    pub fn new() -> Self {
274        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
275            panic!(
276                "{}
277::{}
278 failed to instantiate",
279                ::core::stringify!(BattleMath),
280                ::core::stringify!(new),
281            )
282        });
283        <Self as IBattleMathMethods>::ctor(this);
284        this
285    }
286}
287
288#[cfg(feature = "app-battlemath")]
289pub trait IBattleMath_ProbabilityMethods: IBattleMath_Probability {
290    #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` overload"]
291    fn ctor(self, object: impl ::core::convert::Into<crate::system::object::Object>, method: impl ::core::convert::Into<::unity::IntPtr>) -> () {
292        unsafe {
293            let __receiver =
294                <BattleMath_Probability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
295            ::unity::il2cpp_call!((::unity::module_base()+0x19bb100usize)as*mut u8,();
296(BattleMath_Probability)__receiver,(crate::system::object::Object)::core::convert::Into::into(object),(::unity::IntPtr)::core::convert::Into::into(method))
297        }
298    }
299    #[doc = "`Invoke(i32)` overload"]
300    fn invoke(self, ratio: impl ::core::convert::Into<i32>) -> bool {
301        unsafe {
302            let __receiver =
303                <BattleMath_Probability as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
304            {
305                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
306                let __vi = *__vt.get(13usize).unwrap_or_else(|| {
307                    panic!(
308                        "unity: virtual slot {}
309 out of range (vtable len {}
310) on the runtime class behind {}
311 (method `{}
312`)",
313                        13usize,
314                        __vt.len(),
315                        <BattleMath_Probability as ::unity::ClassIdentity>::NAME,
316                        "Invoke",
317                    )
318                });
319                let __inner: extern "C" fn(BattleMath_Probability, i32, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__vi.method_ptr);
320                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
321                __inner(__receiver, ::core::convert::Into::into(ratio), __mi)
322            }
323        }
324    }
325}
326
327#[cfg(feature = "app-battlemath")]
328impl<__T: IBattleMath_Probability> IBattleMath_ProbabilityMethods for __T {}
329
330#[cfg(feature = "app-battlemath")]
331impl BattleMath_Probability {
332    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
333        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
334    }
335
336    pub fn invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
337        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
338    }
339}
340
341#[cfg(feature = "app-battlemath")]
342impl BattleMath_Probability {
343    #[doc = "Direct (non-virtual) call to `BattleMath_Probability`'s own `Invoke`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
344    pub unsafe fn invoke(this: impl ::core::convert::Into<::unity::IlInstance>, ratio: i32) -> bool {
345        let __mi = Self::invoke_method_info();
346        let __inner: extern "C" fn(::unity::IlInstance, i32, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__mi.method_ptr);
347        __inner(this.into(), ratio, ::core::option::Option::None)
348    }
349}
350
351#[cfg(feature = "app-battlemath")]
352impl BattleMath_Probability {
353    #[doc = "`.ctor(crate::system::object::Object, ::unity::IntPtr)` — overload selector"]
354    pub fn new(object: crate::system::object::Object, method: ::unity::IntPtr) -> Self {
355        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
356            panic!(
357                "{}
358::{}
359 failed to instantiate",
360                ::core::stringify!(BattleMath_Probability),
361                ::core::stringify!(new),
362            )
363        });
364        <Self as IBattleMath_ProbabilityMethods>::ctor(this, object, method);
365        this
366    }
367}
368
369#[cfg(feature = "app-battlemath")]
370#[doc(hidden)]
371pub mod prelude {
372    pub use super::{BattleMath, BattleMath_Probability, IBattleMath, IBattleMathMethods, IBattleMath_Probability, IBattleMath_ProbabilityMethods};
373    #[cfg(feature = "system-delegate")]
374    pub use crate::system::delegate::IDelegateMethods;
375    #[cfg(feature = "system-multicastdelegate")]
376    pub use crate::system::multicastdelegate::IMulticastDelegateMethods;
377    #[cfg(feature = "system-object")]
378    pub use crate::system::object::IObjectMethods;
379    pub use crate::system::{delegate::IDelegate, multicastdelegate::IMulticastDelegate, object::IObject};
380}