Skip to content

Commit 76a2443

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

File tree

9 files changed

+22384
-0
lines changed

9 files changed

+22384
-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(_self, other).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: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,319 @@
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(_self, other).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(_self, other).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(_self, other).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(_self, tick).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(_self, last_run, this_run)
176+
.into();
177+
output
178+
},
179+
);
180+
NamespaceBuilder::<ComponentTicks>::new(world)
181+
.overwrite_script_function(
182+
"clone",
183+
|_self: Ref<bevy::ecs::component::ComponentTicks>| {
184+
let output: Val<bevy::ecs::component::ComponentTicks> = ComponentTicks::clone(
185+
_self,
186+
)
187+
.into();
188+
output
189+
},
190+
)
191+
.overwrite_script_function(
192+
"is_added",
193+
|
194+
_self: Ref<bevy::ecs::component::ComponentTicks>,
195+
last_run: Val<bevy::ecs::component::Tick>,
196+
this_run: Val<bevy::ecs::component::Tick>|
197+
{
198+
let output: bool = ComponentTicks::is_added(
199+
_self,
200+
last_run,
201+
this_run,
202+
)
203+
.into();
204+
output
205+
},
206+
)
207+
.overwrite_script_function(
208+
"is_changed",
209+
|
210+
_self: Ref<bevy::ecs::component::ComponentTicks>,
211+
last_run: Val<bevy::ecs::component::Tick>,
212+
this_run: Val<bevy::ecs::component::Tick>|
213+
{
214+
let output: bool = ComponentTicks::is_changed(
215+
_self,
216+
last_run,
217+
this_run,
218+
)
219+
.into();
220+
output
221+
},
222+
)
223+
.overwrite_script_function(
224+
"new",
225+
|change_tick: Val<bevy::ecs::component::Tick>| {
226+
let output: Val<bevy::ecs::component::ComponentTicks> = ComponentTicks::new(
227+
change_tick,
228+
)
229+
.into();
230+
output
231+
},
232+
)
233+
.overwrite_script_function(
234+
"set_changed",
235+
|
236+
_self: Mut<bevy::ecs::component::ComponentTicks>,
237+
change_tick: Val<bevy::ecs::component::Tick>|
238+
{
239+
let output: () = ComponentTicks::set_changed(_self, change_tick)
240+
.into();
241+
output
242+
},
243+
);
244+
NamespaceBuilder::<Identifier>::new(world)
245+
.overwrite_script_function(
246+
"clone",
247+
|_self: Ref<bevy::ecs::identifier::Identifier>| {
248+
let output: Val<bevy::ecs::identifier::Identifier> = Identifier::clone(
249+
_self,
250+
)
251+
.into();
252+
output
253+
},
254+
)
255+
.overwrite_script_function(
256+
"low",
257+
|_self: Val<bevy::ecs::identifier::Identifier>| {
258+
let output: u32 = Identifier::low(_self).into();
259+
output
260+
},
261+
)
262+
.overwrite_script_function(
263+
"masked_high",
264+
|_self: Val<bevy::ecs::identifier::Identifier>| {
265+
let output: u32 = Identifier::masked_high(_self).into();
266+
output
267+
},
268+
)
269+
.overwrite_script_function(
270+
"to_bits",
271+
|_self: Val<bevy::ecs::identifier::Identifier>| {
272+
let output: u64 = Identifier::to_bits(_self).into();
273+
output
274+
},
275+
)
276+
.overwrite_script_function(
277+
"from_bits",
278+
|value: u64| {
279+
let output: Val<bevy::ecs::identifier::Identifier> = Identifier::from_bits(
280+
value,
281+
)
282+
.into();
283+
output
284+
},
285+
)
286+
.overwrite_script_function(
287+
"eq",
288+
|
289+
_self: Ref<bevy::ecs::identifier::Identifier>,
290+
other: Ref<bevy::ecs::identifier::Identifier>|
291+
{
292+
let output: bool = Identifier::eq(_self, other).into();
293+
output
294+
},
295+
);
296+
NamespaceBuilder::<EntityHash>::new(world)
297+
.overwrite_script_function(
298+
"clone",
299+
|_self: Ref<bevy::ecs::entity::EntityHash>| {
300+
let output: Val<bevy::ecs::entity::EntityHash> = EntityHash::clone(
301+
_self,
302+
)
303+
.into();
304+
output
305+
},
306+
);
307+
NamespaceBuilder::<RemovedComponentEntity>::new(world)
308+
.overwrite_script_function(
309+
"clone",
310+
|_self: Ref<bevy::ecs::removal_detection::RemovedComponentEntity>| {
311+
let output: Val<
312+
bevy::ecs::removal_detection::RemovedComponentEntity,
313+
> = RemovedComponentEntity::clone(_self).into();
314+
output
315+
},
316+
);
317+
NamespaceBuilder::<SystemIdMarker>::new(world);
318+
}
319+
}

0 commit comments

Comments
 (0)