@@ -47,32 +47,15 @@ use std::{
47
47
/// `Entity` can be a part of a query, e.g. `Query<(Entity, &MyComponent)>`.
48
48
/// Components of a specific entity can be accessed using
49
49
/// [`Query::get`](crate::system::Query::get) and related methods.
50
- #[ cfg( target_endian = "little" ) ]
51
50
#[ derive( Clone , Copy ) ]
52
51
#[ repr( C , align( 8 ) ) ]
53
52
pub struct Entity {
54
53
// Do not reorder the fields here. The ordering is explicitly used by repr(C)
55
- // to make this struct equivalent to a u64 on little endian systems.
54
+ // to make this struct equivalent to a u64.
55
+ #[ cfg( target_endian = "little" ) ]
56
56
pub ( crate ) id : u32 ,
57
57
pub ( crate ) generation : u32 ,
58
- }
59
-
60
- /// Lightweight unique ID of an entity.
61
- ///
62
- /// Obtained from [`World::spawn`](crate::world::World::spawn), typically via
63
- /// [`Commands::spawn`](crate::system::Commands::spawn). Can be stored to refer to an entity in the
64
- /// future.
65
- ///
66
- /// `Entity` can be a part of a query, e.g. `Query<(Entity, &MyComponent)>`.
67
- /// Components of a specific entity can be accessed using
68
- /// [`Query::get`](crate::system::Query::get) and related methods.
69
- #[ cfg( target_endian = "big" ) ]
70
- #[ derive( Clone , Copy ) ]
71
- #[ repr( C , align( 8 ) ) ]
72
- pub struct Entity {
73
- // Do not reorder the fields here. The ordering is explicitly used by repr(C)
74
- // to make this struct equivalent to a u64 on big endian systems.
75
- pub ( crate ) generation : u32 ,
58
+ #[ cfg( target_endian = "big" ) ]
76
59
pub ( crate ) id : u32 ,
77
60
}
78
61
0 commit comments