Skip to main content

engage/generated/moon_sharp/interpreter/tree/statements/
ifstatement.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::{
9        moon_sharp::interpreter::tree::{
10            nodebase::{INodeBase, NodeBase},
11            statement::{IStatement, Statement},
12        },
13        system::object::{IObject, Object},
14    };
15
16    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/tree/statements/ifstatement/IfStatement.md"))]
17    #[::unity::class(namespace = "MoonSharp.Interpreter.Tree.Statements", name = "IfStatement")]
18    #[parent(crate::moon_sharp::interpreter::tree::statement::Statement)]
19    pub struct IfStatement {
20        #[offset(32)]
21        #[rename(name = "m_Ifs")]
22        pub m_ifs:
23            crate::system::collections::generic::list_1::List_1<crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock>,
24        #[offset(40)]
25        #[rename(name = "m_Else")]
26        pub m_else: crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock,
27        #[offset(48)]
28        #[rename(name = "m_End")]
29        pub m_end: crate::moon_sharp::interpreter::debugging::sourceref::SourceRef,
30    }
31
32    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/tree/statements/ifstatement/IfStatement_IfBlock.md"))]
33    #[::unity::class(namespace = "MoonSharp.Interpreter.Tree.Statements", name = "IfStatement.IfBlock")]
34    #[parent(crate::system::object::Object)]
35    pub struct IfStatement_IfBlock {
36        #[offset(16)]
37        #[rename(name = "Exp")]
38        pub exp: crate::moon_sharp::interpreter::tree::expression::Expression,
39        #[offset(24)]
40        #[rename(name = "Block")]
41        pub block: crate::moon_sharp::interpreter::tree::statement::Statement,
42        #[offset(32)]
43        #[rename(name = "StackFrame")]
44        pub stack_frame: crate::moon_sharp::interpreter::execution::runtimescopeblock::RuntimeScopeBlock,
45        #[offset(40)]
46        #[rename(name = "Source")]
47        pub source: crate::moon_sharp::interpreter::debugging::sourceref::SourceRef,
48    }
49}
50
51#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement-types")]
52pub use __types::*;
53
54#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
55#[doc(hidden)]
56#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
57mod __IfStatement_unity_raw {
58    use super::*;
59    #[doc(hidden)]
60    #[allow(non_snake_case)]
61    pub mod __lookup_ctor {
62        use super::*;
63        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
64            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
65                &[<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext as ::unity::IlType>::il_type()];
66            ::unity::lookup::method_info_on_class_with_signature(<IfStatement as ::unity::ClassIdentity>::class(), ".ctor", 1, param_types, false)
67        });
68        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
69            match &*METHOD {
70                ::core::result::Result::Ok(mi) => *mi,
71                ::core::result::Result::Err(e) => {
72                    panic!(
73                        "method lookup failed: {}
74::{}
75: {}
76",
77                        <IfStatement as ::unity::ClassIdentity>::NAME,
78                        ".ctor",
79                        e
80                    )
81                },
82            }
83        }
84    }
85    #[doc(hidden)]
86    #[allow(non_snake_case)]
87    pub mod __lookup_create_if_block {
88        use super::*;
89        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
90            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
91                &[<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext as ::unity::IlType>::il_type()];
92            ::unity::lookup::method_info_on_class_with_signature(
93                <IfStatement as ::unity::ClassIdentity>::class(),
94                "CreateIfBlock",
95                1,
96                param_types,
97                false,
98            )
99        });
100        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
101            match &*METHOD {
102                ::core::result::Result::Ok(mi) => *mi,
103                ::core::result::Result::Err(e) => {
104                    panic!(
105                        "method lookup failed: {}
106::{}
107: {}
108",
109                        <IfStatement as ::unity::ClassIdentity>::NAME,
110                        "CreateIfBlock",
111                        e
112                    )
113                },
114            }
115        }
116    }
117    #[doc(hidden)]
118    #[allow(non_snake_case)]
119    pub mod __lookup_create_else_block {
120        use super::*;
121        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
122            let param_types: &[&'static ::unity::il2cpp::Il2CppType] =
123                &[<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext as ::unity::IlType>::il_type()];
124            ::unity::lookup::method_info_on_class_with_signature(
125                <IfStatement as ::unity::ClassIdentity>::class(),
126                "CreateElseBlock",
127                1,
128                param_types,
129                false,
130            )
131        });
132        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
133            match &*METHOD {
134                ::core::result::Result::Ok(mi) => *mi,
135                ::core::result::Result::Err(e) => {
136                    panic!(
137                        "method lookup failed: {}
138::{}
139: {}
140",
141                        <IfStatement as ::unity::ClassIdentity>::NAME,
142                        "CreateElseBlock",
143                        e
144                    )
145                },
146            }
147        }
148    }
149}
150
151#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
152pub trait IIfStatementMethods: IIfStatement {
153    #[doc = "`.ctor(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)` overload"]
154    fn ctor(self, lcontext: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext>) -> () {
155        unsafe {
156            let __receiver = <IfStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
157            ::unity::il2cpp_call!(__IfStatement_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
158(IfStatement)__receiver,(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)::core::convert::Into::into(lcontext))
159        }
160    }
161    #[doc = "`CreateIfBlock(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)` overload"]
162    fn create_if_block(
163        self,
164        lcontext: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext>,
165    ) -> crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock {
166        unsafe {
167            let __receiver = <IfStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
168            ::unity::il2cpp_call!(__IfStatement_unity_raw::__lookup_create_if_block::get_method_info().method_ptr,crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock;
169(IfStatement)__receiver,(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)::core::convert::Into::into(lcontext))
170        }
171    }
172    #[doc = "`CreateElseBlock(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)` overload"]
173    fn create_else_block(
174        self,
175        lcontext: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext>,
176    ) -> crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock {
177        unsafe {
178            let __receiver = <IfStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
179            ::unity::il2cpp_call!(__IfStatement_unity_raw::__lookup_create_else_block::get_method_info().method_ptr,crate::moon_sharp::interpreter::tree::statements::ifstatement::IfStatement_IfBlock;
180(IfStatement)__receiver,(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)::core::convert::Into::into(lcontext))
181        }
182    }
183    #[doc = "`Compile(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)` overload"]
184    fn compile(self, bc: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode>) -> () {
185        unsafe {
186            let __receiver = <IfStatement as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
187            {
188                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
189                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
190                    panic!(
191                        "unity: virtual slot {}
192 out of range (vtable len {}
193) on the runtime class behind {}
194 (method `{}
195`)",
196                        4usize,
197                        __vt.len(),
198                        <IfStatement as ::unity::ClassIdentity>::NAME,
199                        "Compile",
200                    )
201                });
202                let __inner: extern "C" fn(
203                    IfStatement,
204                    crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
205                    ::unity::OptionalMethod,
206                ) -> () = ::core::mem::transmute(__vi.method_ptr);
207                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
208                __inner(__receiver, ::core::convert::Into::into(bc), __mi)
209            }
210        }
211    }
212}
213
214#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
215impl<__T: IIfStatement> IIfStatementMethods for __T {}
216
217#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
218impl IfStatement {
219    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
220        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
221    }
222
223    pub fn create_if_block_method_info() -> &'static ::unity::il2cpp::MethodInfo {
224        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
225    }
226
227    pub fn create_else_block_method_info() -> &'static ::unity::il2cpp::MethodInfo {
228        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
229    }
230
231    pub fn compile_method_info() -> &'static ::unity::il2cpp::MethodInfo {
232        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
233    }
234}
235
236#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
237impl IfStatement {
238    #[doc = "Direct (non-virtual) call to `IfStatement`'s own `Compile`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
239    pub unsafe fn compile(
240        this: impl ::core::convert::Into<::unity::IlInstance>,
241        bc: crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
242    ) -> () {
243        let __mi = Self::compile_method_info();
244        let __inner: extern "C" fn(
245            ::unity::IlInstance,
246            crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
247            ::unity::OptionalMethod,
248        ) -> () = ::core::mem::transmute(__mi.method_ptr);
249        __inner(this.into(), bc, ::core::option::Option::None)
250    }
251}
252
253#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
254impl IfStatement {
255    #[doc = "`.ctor(crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext)` — overload selector"]
256    pub fn new(lcontext: crate::moon_sharp::interpreter::execution::scriptloadingcontext::ScriptLoadingContext) -> Self {
257        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
258            panic!(
259                "{}
260::{}
261 failed to instantiate",
262                ::core::stringify!(IfStatement),
263                ::core::stringify!(new),
264            )
265        });
266        <Self as IIfStatementMethods>::ctor(this, lcontext);
267        this
268    }
269}
270
271#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
272#[doc(hidden)]
273#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
274mod __IfStatement_IfBlock_unity_raw {
275    use super::*;
276    #[doc(hidden)]
277    #[allow(non_snake_case)]
278    pub mod __lookup_ctor {
279        use super::*;
280        static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
281            let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
282            ::unity::lookup::method_info_on_class_with_signature(
283                <IfStatement_IfBlock as ::unity::ClassIdentity>::class(),
284                ".ctor",
285                0,
286                param_types,
287                false,
288            )
289        });
290        pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
291            match &*METHOD {
292                ::core::result::Result::Ok(mi) => *mi,
293                ::core::result::Result::Err(e) => {
294                    panic!(
295                        "method lookup failed: {}
296::{}
297: {}
298",
299                        <IfStatement_IfBlock as ::unity::ClassIdentity>::NAME,
300                        ".ctor",
301                        e
302                    )
303                },
304            }
305        }
306    }
307}
308
309#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
310pub trait IIfStatement_IfBlockMethods: IIfStatement_IfBlock {
311    #[doc = "`.ctor()` overload"]
312    fn ctor(self) -> () {
313        unsafe {
314            let __receiver = <IfStatement_IfBlock as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
315            ::unity::il2cpp_call!(__IfStatement_IfBlock_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
316(IfStatement_IfBlock)__receiver)
317        }
318    }
319}
320
321#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
322impl<__T: IIfStatement_IfBlock> IIfStatement_IfBlockMethods for __T {}
323
324#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
325impl IfStatement_IfBlock {
326    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
327        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
328    }
329}
330
331#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
332impl IfStatement_IfBlock {
333    #[doc = "`.ctor()` — no args"]
334    pub fn new() -> Self {
335        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
336            panic!(
337                "{}
338::{}
339 failed to instantiate",
340                ::core::stringify!(IfStatement_IfBlock),
341                ::core::stringify!(new),
342            )
343        });
344        <Self as IIfStatement_IfBlockMethods>::ctor(this);
345        this
346    }
347}
348
349#[cfg(feature = "moon_sharp-interpreter-tree-statements-ifstatement")]
350#[doc(hidden)]
351pub mod prelude {
352    pub use super::{IIfStatement, IIfStatementMethods, IIfStatement_IfBlock, IIfStatement_IfBlockMethods, IfStatement, IfStatement_IfBlock};
353    #[cfg(feature = "moon_sharp-interpreter-tree-nodebase")]
354    pub use crate::moon_sharp::interpreter::tree::nodebase::INodeBaseMethods;
355    #[cfg(feature = "moon_sharp-interpreter-tree-statement")]
356    pub use crate::moon_sharp::interpreter::tree::statement::IStatementMethods;
357    #[cfg(feature = "system-object")]
358    pub use crate::system::object::IObjectMethods;
359    pub use crate::{
360        moon_sharp::interpreter::tree::{nodebase::INodeBase, statement::IStatement},
361        system::object::IObject,
362    };
363}