5
5
use super :: bevy_reflect:: * ;
6
6
use bevy_mod_scripting_core:: {
7
7
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
+ } ,
9
15
} ;
10
16
use crate :: * ;
11
17
pub struct BevyEcsScriptingPlugin ;
12
18
impl :: bevy:: app:: Plugin for BevyEcsScriptingPlugin {
13
19
fn build ( & self , app : & mut :: bevy:: prelude:: App ) {
14
20
let mut world = app. world_mut ( ) ;
15
21
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
- )
39
22
. register (
40
23
"from_raw" ,
41
24
|index : u32 | {
@@ -85,12 +68,45 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
85
68
. into ( ) ;
86
69
output
87
70
} ,
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
+ } ,
88
94
) ;
89
95
NamespaceBuilder :: < :: bevy:: ecs:: world:: OnAdd > :: new ( world) ;
90
96
NamespaceBuilder :: < :: bevy:: ecs:: world:: OnInsert > :: new ( world) ;
91
97
NamespaceBuilder :: < :: bevy:: ecs:: world:: OnRemove > :: new ( world) ;
92
98
NamespaceBuilder :: < :: bevy:: ecs:: world:: OnReplace > :: new ( world) ;
93
99
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
+ )
94
110
. register (
95
111
"eq" ,
96
112
|
@@ -114,16 +130,6 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
114
130
output
115
131
} ,
116
132
)
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
- )
127
133
. register (
128
134
"new" ,
129
135
|index : usize | {
@@ -145,6 +151,29 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
145
151
} ,
146
152
) ;
147
153
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
+ )
148
177
. register (
149
178
"new" ,
150
179
|tick : u32 | {
@@ -188,39 +217,26 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
188
217
} ,
189
218
)
190
219
. 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" ,
205
221
|_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 (
207
223
& _self,
208
224
)
209
225
. into ( ) ;
210
226
output
211
227
} ,
212
- )
228
+ ) ;
229
+ NamespaceBuilder :: < :: bevy:: ecs:: component:: ComponentTicks > :: new ( world)
213
230
. register (
214
231
"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 (
217
234
& _self,
218
235
)
219
236
. into ( ) ;
220
237
output
221
238
} ,
222
- ) ;
223
- NamespaceBuilder :: < :: bevy:: ecs:: component:: ComponentTicks > :: new ( world)
239
+ )
224
240
. register (
225
241
"is_added" ,
226
242
|
@@ -276,18 +292,21 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
276
292
. into ( ) ;
277
293
output
278
294
} ,
279
- )
295
+ ) ;
296
+ NamespaceBuilder :: < :: bevy:: ecs:: identifier:: Identifier > :: new ( world)
280
297
. 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)
286
306
. into ( ) ;
287
307
output
288
308
} ,
289
- ) ;
290
- NamespaceBuilder :: < :: bevy:: ecs:: identifier:: Identifier > :: new ( world)
309
+ )
291
310
. register (
292
311
"clone" ,
293
312
|_self : Ref < bevy:: ecs:: identifier:: Identifier > | {
@@ -337,19 +356,6 @@ impl ::bevy::app::Plugin for BevyEcsScriptingPlugin {
337
356
. into ( ) ;
338
357
output
339
358
} ,
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
- } ,
353
359
) ;
354
360
NamespaceBuilder :: < :: bevy:: ecs:: entity:: EntityHash > :: new ( world)
355
361
. register (
0 commit comments