@@ -12,6 +12,23 @@ use bevy_script_api::{
1212 derive( clone) ,
1313 remote = "bevy::ecs::entity::Entity" ,
1414 functions[ r#"
15+
16+ #[lua(
17+ as_trait = "std::cmp::PartialEq",
18+ kind = "MetaFunction",
19+ composite = "eq",
20+ metamethod = "Eq",
21+ )]
22+ fn eq(&self, #[proxy] other: &entity::Entity) -> bool;
23+
24+ "# ,
25+ r#"
26+
27+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
28+ fn clone(&self) -> bevy::ecs::entity::Entity;
29+
30+ "# ,
31+ r#"
1532/// Creates a new entity ID with the specified `index` and a generation of 1.
1633/// # Note
1734/// Spawning a specific `entity` value is __rarely the right choice__. Most apps should favor
@@ -64,23 +81,6 @@ use bevy_script_api::{
6481 #[lua(kind = "Method")]
6582 fn generation(self) -> u32;
6683
67- "# ,
68- r#"
69-
70- #[lua(
71- as_trait = "std::cmp::PartialEq",
72- kind = "MetaFunction",
73- composite = "eq",
74- metamethod = "Eq",
75- )]
76- fn eq(&self, #[proxy] other: &entity::Entity) -> bool;
77-
78- "# ,
79- r#"
80-
81- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
82- fn clone(&self) -> bevy::ecs::entity::Entity;
83-
8484"# ,
8585 r#"
8686#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -89,18 +89,12 @@ fn index(&self) -> String {
8989}
9090"# ]
9191) ]
92- pub struct Entity { }
92+ struct Entity { }
9393#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
9494#[ proxy(
9595 derive( clone) ,
9696 remote = "bevy::ecs::component::ComponentId" ,
9797 functions[ r#"
98-
99- #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
100- fn assert_receiver_is_total_eq(&self) -> ();
101-
102- "# ,
103- r#"
10498/// Creates a new [`ComponentId`].
10599/// The `index` is a unique value associated with each type of component in a given world.
106100/// Usually, this value is taken from a counter incremented for each type of component registered with the world.
@@ -118,8 +112,8 @@ pub struct Entity {}
118112"# ,
119113 r#"
120114
121- #[lua(as_trait = "std::clone::Clone ", kind = "Method", output(proxy) )]
122- fn clone (&self) -> bevy::ecs::component::ComponentId ;
115+ #[lua(as_trait = "std::cmp::Eq ", kind = "Method")]
116+ fn assert_receiver_is_total_eq (&self) -> () ;
123117
124118"# ,
125119 r#"
@@ -132,6 +126,12 @@ pub struct Entity {}
132126 )]
133127 fn eq(&self, #[proxy] other: &component::ComponentId) -> bool;
134128
129+ "# ,
130+ r#"
131+
132+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
133+ fn clone(&self) -> bevy::ecs::component::ComponentId;
134+
135135"# ,
136136 r#"
137137#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -140,20 +140,21 @@ fn index(&self) -> String {
140140}
141141"# ]
142142) ]
143- pub struct ComponentId ( ) ;
143+ struct ComponentId ( ) ;
144144#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
145145#[ proxy(
146146 derive( clone) ,
147147 remote = "bevy::ecs::component::Tick" ,
148148 functions[ r#"
149149
150- #[lua(
151- as_trait = "std::cmp::PartialEq",
152- kind = "MetaFunction",
153- composite = "eq",
154- metamethod = "Eq",
155- )]
156- fn eq(&self, #[proxy] other: &component::Tick) -> bool;
150+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
151+ fn clone(&self) -> bevy::ecs::component::Tick;
152+
153+ "# ,
154+ r#"
155+
156+ #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
157+ fn assert_receiver_is_total_eq(&self) -> ();
157158
158159"# ,
159160 r#"
@@ -193,14 +194,13 @@ pub struct ComponentId();
193194"# ,
194195 r#"
195196
196- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
197- fn clone(&self) -> bevy::ecs::component::Tick;
198-
199- "# ,
200- r#"
201-
202- #[lua(as_trait = "std::cmp::Eq", kind = "Method")]
203- fn assert_receiver_is_total_eq(&self) -> ();
197+ #[lua(
198+ as_trait = "std::cmp::PartialEq",
199+ kind = "MetaFunction",
200+ composite = "eq",
201+ metamethod = "Eq",
202+ )]
203+ fn eq(&self, #[proxy] other: &component::Tick) -> bool;
204204
205205"# ,
206206 r#"
@@ -210,12 +210,18 @@ fn index(&self) -> String {
210210}
211211"# ]
212212) ]
213- pub struct Tick { }
213+ struct Tick { }
214214#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
215215#[ proxy(
216216 derive( clone) ,
217217 remote = "bevy::ecs::component::ComponentTicks" ,
218218 functions[ r#"
219+
220+ #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
221+ fn clone(&self) -> bevy::ecs::component::ComponentTicks;
222+
223+ "# ,
224+ r#"
219225/// Returns `true` if the component or resource was added after the system last ran.
220226
221227 #[lua(kind = "Method")]
@@ -271,12 +277,6 @@ pub struct Tick {}
271277 #[lua(kind = "MutatingMethod")]
272278 fn set_changed(&mut self, #[proxy] change_tick: bevy::ecs::component::Tick) -> ();
273279
274- "# ,
275- r#"
276-
277- #[lua(as_trait = "std::clone::Clone", kind = "Method", output(proxy))]
278- fn clone(&self) -> bevy::ecs::component::ComponentTicks;
279-
280280"# ,
281281 r#"
282282#[lua(kind="MetaMethod", metamethod="ToString")]
@@ -285,7 +285,7 @@ fn index(&self) -> String {
285285}
286286"# ]
287287) ]
288- pub struct ComponentTicks { }
288+ struct ComponentTicks { }
289289#[ derive( bevy_mod_scripting_lua_derive:: LuaProxy ) ]
290290#[ proxy(
291291 derive( clone) ,
@@ -297,7 +297,7 @@ pub struct ComponentTicks {}
297297
298298"# ]
299299) ]
300- pub struct EntityHash { }
300+ struct EntityHash { }
301301#[ derive( Default ) ]
302302pub ( crate ) struct Globals ;
303303impl bevy_mod_scripting_lua:: tealr:: mlu:: ExportInstances for Globals {
0 commit comments