Skip to content

Commit 2b2a451

Browse files
chore(codegen): update bevy bindings (#195)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d751481 commit 2b2a451

File tree

8 files changed

+3486
-3438
lines changed

8 files changed

+3486
-3438
lines changed

crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_core.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@ use super::bevy_ecs::*;
66
use super::bevy_reflect::*;
77
use bevy_mod_scripting_core::{
88
AddContextInitializer, StoreDocumentation,
9-
bindings::{ReflectReference, function::from::{Ref, Mut, Val}},
9+
bindings::{
10+
ReflectReference,
11+
function::{
12+
from::{Ref, Mut, Val},
13+
namespace::NamespaceBuilder,
14+
},
15+
},
1016
};
1117
use crate::*;
1218
pub struct BevyCoreScriptingPlugin;

crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_ecs.rs

Lines changed: 81 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,20 @@
55
use super::bevy_reflect::*;
66
use bevy_mod_scripting_core::{
77
AddContextInitializer, StoreDocumentation,
8-
bindings::{ReflectReference, function::from::{Ref, Mut, Val}},
8+
bindings::{
9+
ReflectReference,
10+
function::{
11+
from::{Ref, Mut, Val},
12+
namespace::NamespaceBuilder,
13+
},
14+
},
915
};
1016
use crate::*;
1117
pub struct BevyEcsScriptingPlugin;
1218
impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
1319
fn build(&self, app: &mut ::bevy::prelude::App) {
1420
let mut world = app.world_mut();
1521
NamespaceBuilder::<::bevy::ecs::entity::Entity>::new(world)
16-
.register(
17-
"clone",
18-
|_self: Ref<bevy::ecs::entity::Entity>| {
19-
let output: Val<bevy::ecs::entity::Entity> = <bevy::ecs::entity::Entity as std::clone::Clone>::clone(
20-
&_self,
21-
)
22-
.into();
23-
output
24-
},
25-
)
26-
.register(
27-
"eq",
28-
|
29-
_self: Ref<bevy::ecs::entity::Entity>,
30-
other: Ref<bevy::ecs::entity::Entity>|
31-
{
32-
let output: bool = <bevy::ecs::entity::Entity as std::cmp::PartialEq<
33-
bevy::ecs::entity::Entity,
34-
>>::eq(&_self, &other)
35-
.into();
36-
output
37-
},
38-
)
3922
.register(
4023
"from_raw",
4124
|index: u32| {
@@ -85,12 +68,45 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
8568
.into();
8669
output
8770
},
71+
)
72+
.register(
73+
"clone",
74+
|_self: Ref<bevy::ecs::entity::Entity>| {
75+
let output: Val<bevy::ecs::entity::Entity> = <bevy::ecs::entity::Entity as std::clone::Clone>::clone(
76+
&_self,
77+
)
78+
.into();
79+
output
80+
},
81+
)
82+
.register(
83+
"eq",
84+
|
85+
_self: Ref<bevy::ecs::entity::Entity>,
86+
other: Ref<bevy::ecs::entity::Entity>|
87+
{
88+
let output: bool = <bevy::ecs::entity::Entity as std::cmp::PartialEq<
89+
bevy::ecs::entity::Entity,
90+
>>::eq(&_self, &other)
91+
.into();
92+
output
93+
},
8894
);
8995
NamespaceBuilder::<::bevy::ecs::world::OnAdd>::new(world);
9096
NamespaceBuilder::<::bevy::ecs::world::OnInsert>::new(world);
9197
NamespaceBuilder::<::bevy::ecs::world::OnRemove>::new(world);
9298
NamespaceBuilder::<::bevy::ecs::world::OnReplace>::new(world);
9399
NamespaceBuilder::<::bevy::ecs::component::ComponentId>::new(world)
100+
.register(
101+
"assert_receiver_is_total_eq",
102+
|_self: Ref<bevy::ecs::component::ComponentId>| {
103+
let output: () = <bevy::ecs::component::ComponentId as std::cmp::Eq>::assert_receiver_is_total_eq(
104+
&_self,
105+
)
106+
.into();
107+
output
108+
},
109+
)
94110
.register(
95111
"eq",
96112
|
@@ -114,16 +130,6 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
114130
output
115131
},
116132
)
117-
.register(
118-
"assert_receiver_is_total_eq",
119-
|_self: Ref<bevy::ecs::component::ComponentId>| {
120-
let output: () = <bevy::ecs::component::ComponentId as std::cmp::Eq>::assert_receiver_is_total_eq(
121-
&_self,
122-
)
123-
.into();
124-
output
125-
},
126-
)
127133
.register(
128134
"new",
129135
|index: usize| {
@@ -145,6 +151,29 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
145151
},
146152
);
147153
NamespaceBuilder::<::bevy::ecs::component::Tick>::new(world)
154+
.register(
155+
"assert_receiver_is_total_eq",
156+
|_self: Ref<bevy::ecs::component::Tick>| {
157+
let output: () = <bevy::ecs::component::Tick as std::cmp::Eq>::assert_receiver_is_total_eq(
158+
&_self,
159+
)
160+
.into();
161+
output
162+
},
163+
)
164+
.register(
165+
"eq",
166+
|
167+
_self: Ref<bevy::ecs::component::Tick>,
168+
other: Ref<bevy::ecs::component::Tick>|
169+
{
170+
let output: bool = <bevy::ecs::component::Tick as std::cmp::PartialEq<
171+
bevy::ecs::component::Tick,
172+
>>::eq(&_self, &other)
173+
.into();
174+
output
175+
},
176+
)
148177
.register(
149178
"new",
150179
|tick: u32| {
@@ -188,39 +217,26 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
188217
},
189218
)
190219
.register(
191-
"eq",
192-
|
193-
_self: Ref<bevy::ecs::component::Tick>,
194-
other: Ref<bevy::ecs::component::Tick>|
195-
{
196-
let output: bool = <bevy::ecs::component::Tick as std::cmp::PartialEq<
197-
bevy::ecs::component::Tick,
198-
>>::eq(&_self, &other)
199-
.into();
200-
output
201-
},
202-
)
203-
.register(
204-
"assert_receiver_is_total_eq",
220+
"clone",
205221
|_self: Ref<bevy::ecs::component::Tick>| {
206-
let output: () = <bevy::ecs::component::Tick as std::cmp::Eq>::assert_receiver_is_total_eq(
222+
let output: Val<bevy::ecs::component::Tick> = <bevy::ecs::component::Tick as std::clone::Clone>::clone(
207223
&_self,
208224
)
209225
.into();
210226
output
211227
},
212-
)
228+
);
229+
NamespaceBuilder::<::bevy::ecs::component::ComponentTicks>::new(world)
213230
.register(
214231
"clone",
215-
|_self: Ref<bevy::ecs::component::Tick>| {
216-
let output: Val<bevy::ecs::component::Tick> = <bevy::ecs::component::Tick as std::clone::Clone>::clone(
232+
|_self: Ref<bevy::ecs::component::ComponentTicks>| {
233+
let output: Val<bevy::ecs::component::ComponentTicks> = <bevy::ecs::component::ComponentTicks as std::clone::Clone>::clone(
217234
&_self,
218235
)
219236
.into();
220237
output
221238
},
222-
);
223-
NamespaceBuilder::<::bevy::ecs::component::ComponentTicks>::new(world)
239+
)
224240
.register(
225241
"is_added",
226242
|
@@ -276,18 +292,21 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
276292
.into();
277293
output
278294
},
279-
)
295+
);
296+
NamespaceBuilder::<::bevy::ecs::identifier::Identifier>::new(world)
280297
.register(
281-
"clone",
282-
|_self: Ref<bevy::ecs::component::ComponentTicks>| {
283-
let output: Val<bevy::ecs::component::ComponentTicks> = <bevy::ecs::component::ComponentTicks as std::clone::Clone>::clone(
284-
&_self,
285-
)
298+
"eq",
299+
|
300+
_self: Ref<bevy::ecs::identifier::Identifier>,
301+
other: Ref<bevy::ecs::identifier::Identifier>|
302+
{
303+
let output: bool = <bevy::ecs::identifier::Identifier as std::cmp::PartialEq<
304+
bevy::ecs::identifier::Identifier,
305+
>>::eq(&_self, &other)
286306
.into();
287307
output
288308
},
289-
);
290-
NamespaceBuilder::<::bevy::ecs::identifier::Identifier>::new(world)
309+
)
291310
.register(
292311
"clone",
293312
|_self: Ref<bevy::ecs::identifier::Identifier>| {
@@ -337,19 +356,6 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
337356
.into();
338357
output
339358
},
340-
)
341-
.register(
342-
"eq",
343-
|
344-
_self: Ref<bevy::ecs::identifier::Identifier>,
345-
other: Ref<bevy::ecs::identifier::Identifier>|
346-
{
347-
let output: bool = <bevy::ecs::identifier::Identifier as std::cmp::PartialEq<
348-
bevy::ecs::identifier::Identifier,
349-
>>::eq(&_self, &other)
350-
.into();
351-
output
352-
},
353359
);
354360
NamespaceBuilder::<::bevy::ecs::entity::EntityHash>::new(world)
355361
.register(

crates/bevy_mod_scripting_functions/src/bevy_bindings/bevy_hierarchy.rs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ use super::bevy_reflect::*;
77
use super::bevy_core::*;
88
use bevy_mod_scripting_core::{
99
AddContextInitializer, StoreDocumentation,
10-
bindings::{ReflectReference, function::from::{Ref, Mut, Val}},
10+
bindings::{
11+
ReflectReference,
12+
function::{
13+
from::{Ref, Mut, Val},
14+
namespace::NamespaceBuilder,
15+
},
16+
},
1117
};
1218
use crate::*;
1319
pub struct BevyHierarchyScriptingPlugin;
@@ -32,16 +38,6 @@ impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin {
3238
},
3339
);
3440
NamespaceBuilder::<::bevy::hierarchy::prelude::Parent>::new(world)
35-
.register(
36-
"assert_receiver_is_total_eq",
37-
|_self: Ref<bevy::hierarchy::prelude::Parent>| {
38-
let output: () = <bevy::hierarchy::prelude::Parent as std::cmp::Eq>::assert_receiver_is_total_eq(
39-
&_self,
40-
)
41-
.into();
42-
output
43-
},
44-
)
4541
.register(
4642
"eq",
4743
|
@@ -54,6 +50,16 @@ impl ::bevy::app::Plugin for BevyHierarchyScriptingPlugin {
5450
.into();
5551
output
5652
},
53+
)
54+
.register(
55+
"assert_receiver_is_total_eq",
56+
|_self: Ref<bevy::hierarchy::prelude::Parent>| {
57+
let output: () = <bevy::hierarchy::prelude::Parent as std::cmp::Eq>::assert_receiver_is_total_eq(
58+
&_self,
59+
)
60+
.into();
61+
output
62+
},
5763
);
5864
NamespaceBuilder::<::bevy::hierarchy::HierarchyEvent>::new(world)
5965
.register(

0 commit comments

Comments
 (0)