Skip to content

Commit 6f138d3

Browse files
chore(codegen): update bevy bindings
1 parent 6110b50 commit 6f138d3

File tree

9 files changed

+21440
-0
lines changed

9 files changed

+21440
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// @generated by cargo bevy-api-gen generate, modify the templates not this file
2+
#![allow(clippy::all)]
3+
#![allow(unused, deprecated, dead_code)]
4+
#![cfg_attr(rustfmt, rustfmt_skip)]
5+
use super::bevy_ecs::*;
6+
use super::bevy_reflect::*;
7+
use bevy_mod_scripting_core::{
8+
AddContextInitializer, StoreDocumentation, bindings::ReflectReference,
9+
};
10+
use bevy_mod_scripting_functions::RegisterScriptFunction;
11+
use crate::*;
12+
pub struct BevyCoreScriptingPlugin;
13+
impl bevy::app::Plugin for BevyCoreScriptingPlugin {
14+
fn build(&self, app: &mut bevy::prelude::App) {
15+
let mut world = app.world_mut();
16+
NamespaceBuilder::<Name>::new(world)
17+
.overwrite_script_function(
18+
"eq",
19+
|
20+
_self: Ref<bevy::core::prelude::Name>,
21+
other: Ref<bevy::core::prelude::Name>|
22+
{
23+
let output: bool = Name::eq(_selfother).into();
24+
output
25+
},
26+
)
27+
.overwrite_script_function(
28+
"clone",
29+
|_self: Ref<bevy::core::prelude::Name>| {
30+
let output: Val<bevy::core::prelude::Name> = Name::clone(_self)
31+
.into();
32+
output
33+
},
34+
);
35+
}
36+
}
Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
// @generated by cargo bevy-api-gen generate, modify the templates not this file
2+
#![allow(clippy::all)]
3+
#![allow(unused, deprecated, dead_code)]
4+
#![cfg_attr(rustfmt, rustfmt_skip)]
5+
use super::bevy_reflect::*;
6+
use bevy_mod_scripting_core::{
7+
AddContextInitializer, StoreDocumentation, bindings::ReflectReference,
8+
};
9+
use bevy_mod_scripting_functions::RegisterScriptFunction;
10+
use crate::*;
11+
pub struct BevyEcsScriptingPlugin;
12+
impl bevy::app::Plugin for BevyEcsScriptingPlugin {
13+
fn build(&self, app: &mut bevy::prelude::App) {
14+
let mut world = app.world_mut();
15+
NamespaceBuilder::<Entity>::new(world)
16+
.overwrite_script_function(
17+
"from_raw",
18+
|index: u32| {
19+
let output: Val<bevy::ecs::entity::Entity> = Entity::from_raw(index)
20+
.into();
21+
output
22+
},
23+
)
24+
.overwrite_script_function(
25+
"to_bits",
26+
|_self: Val<bevy::ecs::entity::Entity>| {
27+
let output: u64 = Entity::to_bits(_self).into();
28+
output
29+
},
30+
)
31+
.overwrite_script_function(
32+
"from_bits",
33+
|bits: u64| {
34+
let output: Val<bevy::ecs::entity::Entity> = Entity::from_bits(bits)
35+
.into();
36+
output
37+
},
38+
)
39+
.overwrite_script_function(
40+
"index",
41+
|_self: Val<bevy::ecs::entity::Entity>| {
42+
let output: u32 = Entity::index(_self).into();
43+
output
44+
},
45+
)
46+
.overwrite_script_function(
47+
"generation",
48+
|_self: Val<bevy::ecs::entity::Entity>| {
49+
let output: u32 = Entity::generation(_self).into();
50+
output
51+
},
52+
)
53+
.overwrite_script_function(
54+
"eq",
55+
|
56+
_self: Ref<bevy::ecs::entity::Entity>,
57+
other: Ref<bevy::ecs::entity::Entity>|
58+
{
59+
let output: bool = Entity::eq(_selfother).into();
60+
output
61+
},
62+
)
63+
.overwrite_script_function(
64+
"clone",
65+
|_self: Ref<bevy::ecs::entity::Entity>| {
66+
let output: Val<bevy::ecs::entity::Entity> = Entity::clone(_self)
67+
.into();
68+
output
69+
},
70+
);
71+
NamespaceBuilder::<OnAdd>::new(world);
72+
NamespaceBuilder::<OnInsert>::new(world);
73+
NamespaceBuilder::<OnRemove>::new(world);
74+
NamespaceBuilder::<OnReplace>::new(world);
75+
NamespaceBuilder::<ComponentId>::new(world)
76+
.overwrite_script_function(
77+
"eq",
78+
|
79+
_self: Ref<bevy::ecs::component::ComponentId>,
80+
other: Ref<bevy::ecs::component::ComponentId>|
81+
{
82+
let output: bool = ComponentId::eq(_selfother).into();
83+
output
84+
},
85+
)
86+
.overwrite_script_function(
87+
"clone",
88+
|_self: Ref<bevy::ecs::component::ComponentId>| {
89+
let output: Val<bevy::ecs::component::ComponentId> = ComponentId::clone(
90+
_self,
91+
)
92+
.into();
93+
output
94+
},
95+
)
96+
.overwrite_script_function(
97+
"new",
98+
|index: usize| {
99+
let output: Val<bevy::ecs::component::ComponentId> = ComponentId::new(
100+
index,
101+
)
102+
.into();
103+
output
104+
},
105+
)
106+
.overwrite_script_function(
107+
"index",
108+
|_self: Val<bevy::ecs::component::ComponentId>| {
109+
let output: usize = ComponentId::index(_self).into();
110+
output
111+
},
112+
)
113+
.overwrite_script_function(
114+
"assert_receiver_is_total_eq",
115+
|_self: Ref<bevy::ecs::component::ComponentId>| {
116+
let output: () = ComponentId::assert_receiver_is_total_eq(_self)
117+
.into();
118+
output
119+
},
120+
);
121+
NamespaceBuilder::<Tick>::new(world)
122+
.overwrite_script_function(
123+
"assert_receiver_is_total_eq",
124+
|_self: Ref<bevy::ecs::component::Tick>| {
125+
let output: () = Tick::assert_receiver_is_total_eq(_self).into();
126+
output
127+
},
128+
)
129+
.overwrite_script_function(
130+
"eq",
131+
|
132+
_self: Ref<bevy::ecs::component::Tick>,
133+
other: Ref<bevy::ecs::component::Tick>|
134+
{
135+
let output: bool = Tick::eq(_selfother).into();
136+
output
137+
},
138+
)
139+
.overwrite_script_function(
140+
"clone",
141+
|_self: Ref<bevy::ecs::component::Tick>| {
142+
let output: Val<bevy::ecs::component::Tick> = Tick::clone(_self)
143+
.into();
144+
output
145+
},
146+
)
147+
.overwrite_script_function(
148+
"new",
149+
|tick: u32| {
150+
let output: Val<bevy::ecs::component::Tick> = Tick::new(tick).into();
151+
output
152+
},
153+
)
154+
.overwrite_script_function(
155+
"get",
156+
|_self: Val<bevy::ecs::component::Tick>| {
157+
let output: u32 = Tick::get(_self).into();
158+
output
159+
},
160+
)
161+
.overwrite_script_function(
162+
"set",
163+
|_self: Mut<bevy::ecs::component::Tick>, tick: u32| {
164+
let output: () = Tick::set(_selftick).into();
165+
output
166+
},
167+
)
168+
.overwrite_script_function(
169+
"is_newer_than",
170+
|
171+
_self: Val<bevy::ecs::component::Tick>,
172+
last_run: Val<bevy::ecs::component::Tick>,
173+
this_run: Val<bevy::ecs::component::Tick>|
174+
{
175+
let output: bool = Tick::is_newer_than(_selflast_runthis_run).into();
176+
output
177+
},
178+
);
179+
NamespaceBuilder::<ComponentTicks>::new(world)
180+
.overwrite_script_function(
181+
"clone",
182+
|_self: Ref<bevy::ecs::component::ComponentTicks>| {
183+
let output: Val<bevy::ecs::component::ComponentTicks> = ComponentTicks::clone(
184+
_self,
185+
)
186+
.into();
187+
output
188+
},
189+
)
190+
.overwrite_script_function(
191+
"is_added",
192+
|
193+
_self: Ref<bevy::ecs::component::ComponentTicks>,
194+
last_run: Val<bevy::ecs::component::Tick>,
195+
this_run: Val<bevy::ecs::component::Tick>|
196+
{
197+
let output: bool = ComponentTicks::is_added(_selflast_runthis_run)
198+
.into();
199+
output
200+
},
201+
)
202+
.overwrite_script_function(
203+
"is_changed",
204+
|
205+
_self: Ref<bevy::ecs::component::ComponentTicks>,
206+
last_run: Val<bevy::ecs::component::Tick>,
207+
this_run: Val<bevy::ecs::component::Tick>|
208+
{
209+
let output: bool = ComponentTicks::is_changed(_selflast_runthis_run)
210+
.into();
211+
output
212+
},
213+
)
214+
.overwrite_script_function(
215+
"new",
216+
|change_tick: Val<bevy::ecs::component::Tick>| {
217+
let output: Val<bevy::ecs::component::ComponentTicks> = ComponentTicks::new(
218+
change_tick,
219+
)
220+
.into();
221+
output
222+
},
223+
)
224+
.overwrite_script_function(
225+
"set_changed",
226+
|
227+
_self: Mut<bevy::ecs::component::ComponentTicks>,
228+
change_tick: Val<bevy::ecs::component::Tick>|
229+
{
230+
let output: () = ComponentTicks::set_changed(_selfchange_tick)
231+
.into();
232+
output
233+
},
234+
);
235+
NamespaceBuilder::<Identifier>::new(world)
236+
.overwrite_script_function(
237+
"clone",
238+
|_self: Ref<bevy::ecs::identifier::Identifier>| {
239+
let output: Val<bevy::ecs::identifier::Identifier> = Identifier::clone(
240+
_self,
241+
)
242+
.into();
243+
output
244+
},
245+
)
246+
.overwrite_script_function(
247+
"low",
248+
|_self: Val<bevy::ecs::identifier::Identifier>| {
249+
let output: u32 = Identifier::low(_self).into();
250+
output
251+
},
252+
)
253+
.overwrite_script_function(
254+
"masked_high",
255+
|_self: Val<bevy::ecs::identifier::Identifier>| {
256+
let output: u32 = Identifier::masked_high(_self).into();
257+
output
258+
},
259+
)
260+
.overwrite_script_function(
261+
"to_bits",
262+
|_self: Val<bevy::ecs::identifier::Identifier>| {
263+
let output: u64 = Identifier::to_bits(_self).into();
264+
output
265+
},
266+
)
267+
.overwrite_script_function(
268+
"from_bits",
269+
|value: u64| {
270+
let output: Val<bevy::ecs::identifier::Identifier> = Identifier::from_bits(
271+
value,
272+
)
273+
.into();
274+
output
275+
},
276+
)
277+
.overwrite_script_function(
278+
"eq",
279+
|
280+
_self: Ref<bevy::ecs::identifier::Identifier>,
281+
other: Ref<bevy::ecs::identifier::Identifier>|
282+
{
283+
let output: bool = Identifier::eq(_selfother).into();
284+
output
285+
},
286+
);
287+
NamespaceBuilder::<EntityHash>::new(world)
288+
.overwrite_script_function(
289+
"clone",
290+
|_self: Ref<bevy::ecs::entity::EntityHash>| {
291+
let output: Val<bevy::ecs::entity::EntityHash> = EntityHash::clone(
292+
_self,
293+
)
294+
.into();
295+
output
296+
},
297+
);
298+
NamespaceBuilder::<RemovedComponentEntity>::new(world)
299+
.overwrite_script_function(
300+
"clone",
301+
|_self: Ref<bevy::ecs::removal_detection::RemovedComponentEntity>| {
302+
let output: Val<
303+
bevy::ecs::removal_detection::RemovedComponentEntity,
304+
> = RemovedComponentEntity::clone(_self).into();
305+
output
306+
},
307+
);
308+
NamespaceBuilder::<SystemIdMarker>::new(world);
309+
}
310+
}

0 commit comments

Comments
 (0)