engage/generated/moon_sharp/interpreter/loaders/
embeddedresourcesscriptloader.rs1#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 moon_sharp::interpreter::loaders::scriptloaderbase::{IScriptLoaderBase, ScriptLoaderBase},
10 system::object::{IObject, Object},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/loaders/embeddedresourcesscriptloader/EmbeddedResourcesScriptLoader.md"))]
14 #[::unity::class(namespace = "MoonSharp.Interpreter.Loaders", name = "EmbeddedResourcesScriptLoader")]
15 #[parent(crate::moon_sharp::interpreter::loaders::scriptloaderbase::ScriptLoaderBase)]
16 pub struct EmbeddedResourcesScriptLoader {
17 #[offset(32)]
18 #[rename(name = "m_ResourceAssembly")]
19 pub m_resource_assembly: crate::system::reflection::assembly::Assembly,
20 #[offset(40)]
21 #[rename(name = "m_ResourceNames")]
22 pub m_resource_names: crate::system::collections::generic::hashset_1::HashSet_1<::unity::Il2CppString>,
23 #[offset(48)]
24 #[rename(name = "m_Namespace")]
25 pub m_namespace: ::unity::Il2CppString,
26 }
27}
28
29#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader-types")]
30pub use __types::*;
31
32#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
33#[doc(hidden)]
34#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
35mod __EmbeddedResourcesScriptLoader_unity_raw {
36 use super::*;
37 #[doc(hidden)]
38 #[allow(non_snake_case)]
39 pub mod __lookup_ctor {
40 use super::*;
41 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
42 let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
43 &[<crate::system::reflection::assembly::Assembly as ::unity::IlType>::il_type()];
44 ::unity::lookup::method_info_on_class_with_signature(
45 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::class(),
46 ".ctor",
47 1,
48 param_types,
49 false,
50 )
51 });
52 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
53 match &*METHOD {
54 ::core::result::Result::Ok(mi) => *mi,
55 ::core::result::Result::Err(e) => {
56 panic!(
57 "method lookup failed: {}
58::{}
59: {}
60",
61 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::NAME,
62 ".ctor",
63 e
64 )
65 },
66 }
67 }
68 }
69 #[doc(hidden)]
70 #[allow(non_snake_case)]
71 pub mod __lookup_file_name_to_resource {
72 use super::*;
73 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
74 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::Il2CppString as ::unity::IlType>::il_type()];
75 ::unity::lookup::method_info_on_class_with_signature(
76 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::class(),
77 "FileNameToResource",
78 1,
79 param_types,
80 false,
81 )
82 });
83 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
84 match &*METHOD {
85 ::core::result::Result::Ok(mi) => *mi,
86 ::core::result::Result::Err(e) => {
87 panic!(
88 "method lookup failed: {}
89::{}
90: {}
91",
92 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::NAME,
93 "FileNameToResource",
94 e
95 )
96 },
97 }
98 }
99 }
100}
101
102#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
103pub trait IEmbeddedResourcesScriptLoaderMethods: IEmbeddedResourcesScriptLoader {
104 #[doc = "`.ctor(crate::system::reflection::assembly::Assembly)` overload"]
105 fn ctor(self, resource_assembly: impl ::core::convert::Into<crate::system::reflection::assembly::Assembly>) -> () {
106 unsafe {
107 let __receiver =
108 <EmbeddedResourcesScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
109 ::unity::il2cpp_call!(__EmbeddedResourcesScriptLoader_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
110(EmbeddedResourcesScriptLoader)__receiver,(crate::system::reflection::assembly::Assembly)::core::convert::Into::into(resource_assembly))
111 }
112 }
113 #[doc = "`FileNameToResource(::unity::Il2CppString)` overload"]
114 fn file_name_to_resource(self, file: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
115 unsafe {
116 let __receiver =
117 <EmbeddedResourcesScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
118 ::unity::il2cpp_call!(__EmbeddedResourcesScriptLoader_unity_raw::__lookup_file_name_to_resource::get_method_info().method_ptr, ::unity::Il2CppString;
119(EmbeddedResourcesScriptLoader)__receiver,(::unity::Il2CppString)::core::convert::Into::into(file))
120 }
121 }
122 #[doc = "`ScriptFileExists(::unity::Il2CppString)` overload"]
123 fn script_file_exists(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> bool {
124 unsafe {
125 let __receiver =
126 <EmbeddedResourcesScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
127 {
128 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
129 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
130 panic!(
131 "unity: virtual slot {}
132 out of range (vtable len {}
133) on the runtime class behind {}
134 (method `{}
135`)",
136 7usize,
137 __vt.len(),
138 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::NAME,
139 "ScriptFileExists",
140 )
141 });
142 let __inner: extern "C" fn(EmbeddedResourcesScriptLoader, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
143 ::core::mem::transmute(__vi.method_ptr);
144 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
145 __inner(__receiver, ::core::convert::Into::into(name), __mi)
146 }
147 }
148 }
149 #[doc = "`LoadFile(::unity::Il2CppString, crate::moon_sharp::interpreter::table::Table)` overload"]
150 fn load_file(
151 self,
152 file: impl ::core::convert::Into<::unity::Il2CppString>,
153 global_context: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
154 ) -> crate::system::object::Object {
155 unsafe {
156 let __receiver =
157 <EmbeddedResourcesScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
158 {
159 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
160 let __vi = *__vt.get(8usize).unwrap_or_else(|| {
161 panic!(
162 "unity: virtual slot {}
163 out of range (vtable len {}
164) on the runtime class behind {}
165 (method `{}
166`)",
167 8usize,
168 __vt.len(),
169 <EmbeddedResourcesScriptLoader as ::unity::ClassIdentity>::NAME,
170 "LoadFile",
171 )
172 });
173 let __inner: extern "C" fn(
174 EmbeddedResourcesScriptLoader,
175 ::unity::Il2CppString,
176 crate::moon_sharp::interpreter::table::Table,
177 ::unity::OptionalMethod,
178 ) -> crate::system::object::Object = ::core::mem::transmute(__vi.method_ptr);
179 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
180 __inner(
181 __receiver,
182 ::core::convert::Into::into(file),
183 ::core::convert::Into::into(global_context),
184 __mi,
185 )
186 }
187 }
188 }
189}
190
191#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
192impl<__T: IEmbeddedResourcesScriptLoader> IEmbeddedResourcesScriptLoaderMethods for __T {}
193
194#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
195impl EmbeddedResourcesScriptLoader {
196 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
197 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
198 }
199
200 pub fn file_name_to_resource_method_info() -> &'static ::unity::il2cpp::MethodInfo {
201 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
202 }
203
204 pub fn script_file_exists_method_info() -> &'static ::unity::il2cpp::MethodInfo {
205 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
206 }
207
208 pub fn load_file_method_info() -> &'static ::unity::il2cpp::MethodInfo {
209 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
210 }
211}
212
213#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
214impl EmbeddedResourcesScriptLoader {
215 #[doc = "Direct (non-virtual) call to `EmbeddedResourcesScriptLoader`'s own `ScriptFileExists`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
216 pub unsafe fn script_file_exists(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString) -> bool {
217 let __mi = Self::script_file_exists_method_info();
218 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
219 ::core::mem::transmute(__mi.method_ptr);
220 __inner(this.into(), name, ::core::option::Option::None)
221 }
222
223 #[doc = "Direct (non-virtual) call to `EmbeddedResourcesScriptLoader`'s own `LoadFile`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
224 pub unsafe fn load_file(
225 this: impl ::core::convert::Into<::unity::IlInstance>,
226 file: ::unity::Il2CppString,
227 global_context: crate::moon_sharp::interpreter::table::Table,
228 ) -> crate::system::object::Object {
229 let __mi = Self::load_file_method_info();
230 let __inner: extern "C" fn(
231 ::unity::IlInstance,
232 ::unity::Il2CppString,
233 crate::moon_sharp::interpreter::table::Table,
234 ::unity::OptionalMethod,
235 ) -> crate::system::object::Object = ::core::mem::transmute(__mi.method_ptr);
236 __inner(this.into(), file, global_context, ::core::option::Option::None)
237 }
238}
239
240#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
241impl EmbeddedResourcesScriptLoader {
242 #[doc = "`.ctor(crate::system::reflection::assembly::Assembly)` — overload selector"]
243 pub fn new(resource_assembly: crate::system::reflection::assembly::Assembly) -> Self {
244 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
245 panic!(
246 "{}
247::{}
248 failed to instantiate",
249 ::core::stringify!(EmbeddedResourcesScriptLoader),
250 ::core::stringify!(new),
251 )
252 });
253 <Self as IEmbeddedResourcesScriptLoaderMethods>::ctor(this, resource_assembly);
254 this
255 }
256}
257
258#[cfg(feature = "moon_sharp-interpreter-loaders-embeddedresourcesscriptloader")]
259#[doc(hidden)]
260pub mod prelude {
261 pub use super::{EmbeddedResourcesScriptLoader, IEmbeddedResourcesScriptLoader, IEmbeddedResourcesScriptLoaderMethods};
262 #[cfg(feature = "moon_sharp-interpreter-loaders-scriptloaderbase")]
263 pub use crate::moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBaseMethods;
264 #[cfg(feature = "system-object")]
265 pub use crate::system::object::IObjectMethods;
266 pub use crate::{moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBase, system::object::IObject};
267}