engage/generated/moon_sharp/interpreter/interop/registration_policies/
automaticregistrationpolicy.rs1#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 moon_sharp::interpreter::interop::registration_policies::defaultregistrationpolicy::{DefaultRegistrationPolicy, IDefaultRegistrationPolicy},
10 system::object::{IObject, Object},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/interop/registration_policies/automaticregistrationpolicy/AutomaticRegistrationPolicy.md"))]
14 #[::unity::class(namespace = "MoonSharp.Interpreter.Interop.RegistrationPolicies", name = "AutomaticRegistrationPolicy")]
15 #[parent(crate::moon_sharp::interpreter::interop::registration_policies::defaultregistrationpolicy::DefaultRegistrationPolicy)]
16 pub struct AutomaticRegistrationPolicy {}
17}
18
19#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy-types")]
20pub use __types::*;
21
22#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
23#[doc(hidden)]
24#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
25mod __AutomaticRegistrationPolicy_unity_raw {
26 use super::*;
27 #[doc(hidden)]
28 #[allow(non_snake_case)]
29 pub mod __lookup_ctor {
30 use super::*;
31 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
32 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
33 ::unity::lookup::method_info_on_class_with_signature(
34 <AutomaticRegistrationPolicy as ::unity::ClassIdentity>::class(),
35 ".ctor",
36 0,
37 param_types,
38 false,
39 )
40 });
41 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
42 match &*METHOD {
43 ::core::result::Result::Ok(mi) => *mi,
44 ::core::result::Result::Err(e) => {
45 panic!(
46 "method lookup failed: {}
47::{}
48: {}
49",
50 <AutomaticRegistrationPolicy as ::unity::ClassIdentity>::NAME,
51 ".ctor",
52 e
53 )
54 },
55 }
56 }
57 }
58}
59
60#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
61pub trait IAutomaticRegistrationPolicyMethods: IAutomaticRegistrationPolicy {
62 #[doc = "`AllowTypeAutoRegistration(::unity::SystemType)` overload"]
63 fn allow_type_auto_registration(self, r#type: impl ::core::convert::Into<::unity::SystemType>) -> bool {
64 unsafe {
65 let __receiver =
66 <AutomaticRegistrationPolicy as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
67 {
68 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
69 let __vi = *__vt.get(6usize).unwrap_or_else(|| {
70 panic!(
71 "unity: virtual slot {}
72 out of range (vtable len {}
73) on the runtime class behind {}
74 (method `{}
75`)",
76 6usize,
77 __vt.len(),
78 <AutomaticRegistrationPolicy as ::unity::ClassIdentity>::NAME,
79 "AllowTypeAutoRegistration",
80 )
81 });
82 let __inner: extern "C" fn(AutomaticRegistrationPolicy, ::unity::SystemType, ::unity::OptionalMethod) -> bool =
83 ::core::mem::transmute(__vi.method_ptr);
84 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
85 __inner(__receiver, ::core::convert::Into::into(r#type), __mi)
86 }
87 }
88 }
89 #[doc = "`.ctor()` overload"]
90 fn ctor(self) -> () {
91 unsafe {
92 let __receiver =
93 <AutomaticRegistrationPolicy as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
94 ::unity::il2cpp_call!(__AutomaticRegistrationPolicy_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
95(AutomaticRegistrationPolicy)__receiver)
96 }
97 }
98}
99
100#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
101impl<__T: IAutomaticRegistrationPolicy> IAutomaticRegistrationPolicyMethods for __T {}
102
103#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
104impl AutomaticRegistrationPolicy {
105 pub fn allow_type_auto_registration_method_info() -> &'static ::unity::il2cpp::MethodInfo {
106 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
107 }
108
109 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
110 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
111 }
112}
113
114#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
115impl AutomaticRegistrationPolicy {
116 #[doc = "Direct (non-virtual) call to `AutomaticRegistrationPolicy`'s own `AllowTypeAutoRegistration`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
117 pub unsafe fn allow_type_auto_registration(this: impl ::core::convert::Into<::unity::IlInstance>, r#type: ::unity::SystemType) -> bool {
118 let __mi = Self::allow_type_auto_registration_method_info();
119 let __inner: extern "C" fn(::unity::IlInstance, ::unity::SystemType, ::unity::OptionalMethod) -> bool =
120 ::core::mem::transmute(__mi.method_ptr);
121 __inner(this.into(), r#type, ::core::option::Option::None)
122 }
123}
124
125#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
126impl AutomaticRegistrationPolicy {
127 #[doc = "`.ctor()` — no args"]
128 pub fn new() -> Self {
129 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
130 panic!(
131 "{}
132::{}
133 failed to instantiate",
134 ::core::stringify!(AutomaticRegistrationPolicy),
135 ::core::stringify!(new),
136 )
137 });
138 <Self as IAutomaticRegistrationPolicyMethods>::ctor(this);
139 this
140 }
141}
142
143#[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-automaticregistrationpolicy")]
144#[doc(hidden)]
145pub mod prelude {
146 pub use super::{AutomaticRegistrationPolicy, IAutomaticRegistrationPolicy, IAutomaticRegistrationPolicyMethods};
147 #[cfg(feature = "moon_sharp-interpreter-interop-registration_policies-defaultregistrationpolicy")]
148 pub use crate::moon_sharp::interpreter::interop::registration_policies::defaultregistrationpolicy::IDefaultRegistrationPolicyMethods;
149 #[cfg(feature = "system-object")]
150 pub use crate::system::object::IObjectMethods;
151 pub use crate::{
152 moon_sharp::interpreter::interop::registration_policies::defaultregistrationpolicy::IDefaultRegistrationPolicy, system::object::IObject,
153 };
154}