55use super :: bevy_reflect:: * ;
66use 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} ;
1016use crate :: * ;
1117pub struct BevyEcsScriptingPlugin ;
1218impl :: 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 (
0 commit comments