engage/generated/moon_sharp/interpreter/tree/
loop.rs1#[cfg(feature = "moon_sharp-interpreter-tree-loop-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::system::object::{IObject, Object};
9
10 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/tree/loop/Loop.md"))]
11 #[::unity::class(namespace = "MoonSharp.Interpreter.Tree", name = "Loop")]
12 #[parent(crate::system::object::Object)]
13 pub struct Loop {
14 #[offset(16)]
15 #[rename(name = "Scope")]
16 pub scope: crate::moon_sharp::interpreter::execution::runtimescopeblock::RuntimeScopeBlock,
17 #[offset(24)]
18 #[rename(name = "BreakJumps")]
19 pub break_jumps: crate::system::collections::generic::list_1::List_1<crate::moon_sharp::interpreter::execution::vm::instruction::Instruction>,
20 }
21}
22
23#[cfg(feature = "moon_sharp-interpreter-tree-loop-types")]
24pub use __types::*;
25
26#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
27#[doc(hidden)]
28#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
29mod __Loop_unity_raw {
30 use super::*;
31 #[doc(hidden)]
32 #[allow(non_snake_case)]
33 pub mod __lookup_ctor {
34 use super::*;
35 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
36 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
37 ::unity::lookup::method_info_on_class_with_signature(<Loop as ::unity::ClassIdentity>::class(), ".ctor", 0, param_types, false)
38 });
39 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
40 match &*METHOD {
41 ::core::result::Result::Ok(mi) => *mi,
42 ::core::result::Result::Err(e) => {
43 panic!(
44 "method lookup failed: {}
45::{}
46: {}
47",
48 <Loop as ::unity::ClassIdentity>::NAME,
49 ".ctor",
50 e
51 )
52 },
53 }
54 }
55 }
56}
57
58#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
59pub trait ILoopMethods: ILoop {
60 #[doc = "`CompileBreak(crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode)` overload"]
61 fn compile_break(self, bc: impl ::core::convert::Into<crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode>) -> () {
62 unsafe {
63 let __receiver = <Loop as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
64 {
65 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
66 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
67 panic!(
68 "unity: virtual slot {}
69 out of range (vtable len {}
70) on the runtime class behind {}
71 (method `{}
72`)",
73 4usize,
74 __vt.len(),
75 <Loop as ::unity::ClassIdentity>::NAME,
76 "CompileBreak",
77 )
78 });
79 let __inner: extern "C" fn(Loop, crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode, ::unity::OptionalMethod) -> () =
80 ::core::mem::transmute(__vi.method_ptr);
81 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
82 __inner(__receiver, ::core::convert::Into::into(bc), __mi)
83 }
84 }
85 }
86 #[doc = "`IsBoundary()` overload"]
87 fn is_boundary(self) -> bool {
88 unsafe {
89 let __receiver = <Loop as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
90 {
91 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
92 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
93 panic!(
94 "unity: virtual slot {}
95 out of range (vtable len {}
96) on the runtime class behind {}
97 (method `{}
98`)",
99 5usize,
100 __vt.len(),
101 <Loop as ::unity::ClassIdentity>::NAME,
102 "IsBoundary",
103 )
104 });
105 let __inner: extern "C" fn(Loop, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__vi.method_ptr);
106 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
107 __inner(__receiver, __mi)
108 }
109 }
110 }
111 #[doc = "`.ctor()` overload"]
112 fn ctor(self) -> () {
113 unsafe {
114 let __receiver = <Loop as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
115 ::unity::il2cpp_call!(__Loop_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
116(Loop)__receiver)
117 }
118 }
119}
120
121#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
122impl<__T: ILoop> ILoopMethods for __T {}
123
124#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
125impl Loop {
126 pub fn compile_break_method_info() -> &'static ::unity::il2cpp::MethodInfo {
127 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
128 }
129
130 pub fn is_boundary_method_info() -> &'static ::unity::il2cpp::MethodInfo {
131 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
132 }
133
134 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
135 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
136 }
137}
138
139#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
140impl Loop {
141 #[doc = "Direct (non-virtual) call to `Loop`'s own `CompileBreak`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
142 pub unsafe fn compile_break(
143 this: impl ::core::convert::Into<::unity::IlInstance>,
144 bc: crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
145 ) -> () {
146 let __mi = Self::compile_break_method_info();
147 let __inner: extern "C" fn(
148 ::unity::IlInstance,
149 crate::moon_sharp::interpreter::execution::vm::bytecode::ByteCode,
150 ::unity::OptionalMethod,
151 ) -> () = ::core::mem::transmute(__mi.method_ptr);
152 __inner(this.into(), bc, ::core::option::Option::None)
153 }
154
155 #[doc = "Direct (non-virtual) call to `Loop`'s own `IsBoundary`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
156 pub unsafe fn is_boundary(this: impl ::core::convert::Into<::unity::IlInstance>) -> bool {
157 let __mi = Self::is_boundary_method_info();
158 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__mi.method_ptr);
159 __inner(this.into(), ::core::option::Option::None)
160 }
161}
162
163#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
164impl Loop {
165 #[doc = "`.ctor()` — no args"]
166 pub fn new() -> Self {
167 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
168 panic!(
169 "{}
170::{}
171 failed to instantiate",
172 ::core::stringify!(Loop),
173 ::core::stringify!(new),
174 )
175 });
176 <Self as ILoopMethods>::ctor(this);
177 this
178 }
179}
180
181#[cfg(feature = "moon_sharp-interpreter-tree-loop")]
182#[doc(hidden)]
183pub mod prelude {
184 pub use super::{ILoop, ILoopMethods, Loop};
185 pub use crate::system::object::IObject;
186 #[cfg(feature = "system-object")]
187 pub use crate::system::object::IObjectMethods;
188}