Skip to main content

engage/generated/moon_sharp/interpreter/loaders/
filesystemscriptloader.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader-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/filesystemscriptloader/FileSystemScriptLoader.md"))]
14    #[::unity::class(namespace = "MoonSharp.Interpreter.Loaders", name = "FileSystemScriptLoader")]
15    #[parent(crate::moon_sharp::interpreter::loaders::scriptloaderbase::ScriptLoaderBase)]
16    pub struct FileSystemScriptLoader {}
17}
18
19#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader-types")]
20pub use __types::*;
21
22#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
23#[doc(hidden)]
24#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
25mod __FileSystemScriptLoader_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                <FileSystemScriptLoader 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                        <FileSystemScriptLoader as ::unity::ClassIdentity>::NAME,
51                        ".ctor",
52                        e
53                    )
54                },
55            }
56        }
57    }
58}
59
60#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
61pub trait IFileSystemScriptLoaderMethods: IFileSystemScriptLoader {
62    #[doc = "`ScriptFileExists(::unity::Il2CppString)` overload"]
63    fn script_file_exists(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> bool {
64        unsafe {
65            let __receiver =
66                <FileSystemScriptLoader 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(7usize).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                        7usize,
77                        __vt.len(),
78                        <FileSystemScriptLoader as ::unity::ClassIdentity>::NAME,
79                        "ScriptFileExists",
80                    )
81                });
82                let __inner: extern "C" fn(FileSystemScriptLoader, ::unity::Il2CppString, ::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(name), __mi)
86            }
87        }
88    }
89    #[doc = "`LoadFile(::unity::Il2CppString, crate::moon_sharp::interpreter::table::Table)` overload"]
90    fn load_file(
91        self,
92        file: impl ::core::convert::Into<::unity::Il2CppString>,
93        global_context: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
94    ) -> crate::system::object::Object {
95        unsafe {
96            let __receiver =
97                <FileSystemScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
98            {
99                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
100                let __vi = *__vt.get(8usize).unwrap_or_else(|| {
101                    panic!(
102                        "unity: virtual slot {}
103 out of range (vtable len {}
104) on the runtime class behind {}
105 (method `{}
106`)",
107                        8usize,
108                        __vt.len(),
109                        <FileSystemScriptLoader as ::unity::ClassIdentity>::NAME,
110                        "LoadFile",
111                    )
112                });
113                let __inner: extern "C" fn(
114                    FileSystemScriptLoader,
115                    ::unity::Il2CppString,
116                    crate::moon_sharp::interpreter::table::Table,
117                    ::unity::OptionalMethod,
118                ) -> crate::system::object::Object = ::core::mem::transmute(__vi.method_ptr);
119                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
120                __inner(
121                    __receiver,
122                    ::core::convert::Into::into(file),
123                    ::core::convert::Into::into(global_context),
124                    __mi,
125                )
126            }
127        }
128    }
129    #[doc = "`.ctor()` overload"]
130    fn ctor(self) -> () {
131        unsafe {
132            let __receiver =
133                <FileSystemScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
134            ::unity::il2cpp_call!(__FileSystemScriptLoader_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
135(FileSystemScriptLoader)__receiver)
136        }
137    }
138}
139
140#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
141impl<__T: IFileSystemScriptLoader> IFileSystemScriptLoaderMethods for __T {}
142
143#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
144impl FileSystemScriptLoader {
145    pub fn script_file_exists_method_info() -> &'static ::unity::il2cpp::MethodInfo {
146        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
147    }
148
149    pub fn load_file_method_info() -> &'static ::unity::il2cpp::MethodInfo {
150        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
151    }
152
153    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
154        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
155    }
156}
157
158#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
159impl FileSystemScriptLoader {
160    #[doc = "Direct (non-virtual) call to `FileSystemScriptLoader`'s own `ScriptFileExists`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
161    pub unsafe fn script_file_exists(this: impl ::core::convert::Into<::unity::IlInstance>, name: ::unity::Il2CppString) -> bool {
162        let __mi = Self::script_file_exists_method_info();
163        let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
164            ::core::mem::transmute(__mi.method_ptr);
165        __inner(this.into(), name, ::core::option::Option::None)
166    }
167
168    #[doc = "Direct (non-virtual) call to `FileSystemScriptLoader`'s own `LoadFile`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
169    pub unsafe fn load_file(
170        this: impl ::core::convert::Into<::unity::IlInstance>,
171        file: ::unity::Il2CppString,
172        global_context: crate::moon_sharp::interpreter::table::Table,
173    ) -> crate::system::object::Object {
174        let __mi = Self::load_file_method_info();
175        let __inner: extern "C" fn(
176            ::unity::IlInstance,
177            ::unity::Il2CppString,
178            crate::moon_sharp::interpreter::table::Table,
179            ::unity::OptionalMethod,
180        ) -> crate::system::object::Object = ::core::mem::transmute(__mi.method_ptr);
181        __inner(this.into(), file, global_context, ::core::option::Option::None)
182    }
183}
184
185#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
186impl FileSystemScriptLoader {
187    #[doc = "`.ctor()` — no args"]
188    pub fn new() -> Self {
189        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
190            panic!(
191                "{}
192::{}
193 failed to instantiate",
194                ::core::stringify!(FileSystemScriptLoader),
195                ::core::stringify!(new),
196            )
197        });
198        <Self as IFileSystemScriptLoaderMethods>::ctor(this);
199        this
200    }
201}
202
203#[cfg(feature = "moon_sharp-interpreter-loaders-filesystemscriptloader")]
204#[doc(hidden)]
205pub mod prelude {
206    pub use super::{FileSystemScriptLoader, IFileSystemScriptLoader, IFileSystemScriptLoaderMethods};
207    #[cfg(feature = "moon_sharp-interpreter-loaders-scriptloaderbase")]
208    pub use crate::moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBaseMethods;
209    #[cfg(feature = "system-object")]
210    pub use crate::system::object::IObjectMethods;
211    pub use crate::{moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBase, system::object::IObject};
212}