@@ -11,25 +11,25 @@ use crate::{
11
11
use std:: any:: TypeId ;
12
12
13
13
impl < ' a , T : Component > WorldQuery for EventWriter < ' a , T > {
14
- type Fetch = EventWriterFetch < ' a , T > ;
14
+ type Fetch = EventWriterFetch < T > ;
15
15
type State = EventWriterState < T > ;
16
16
}
17
17
18
- struct EventWriterFetch < ' s , T > {
18
+ struct EventWriterFetch < T > {
19
19
/// EventWriter query parameters require write access to &mut Events<T>
20
20
write_fetch : WriteFetch < Events < T > > ,
21
- state : & ' s EventWriterState < T > ,
21
+ storage_type : StorageType ,
22
22
}
23
23
24
- impl < ' a , T : Component > Fetch < ' a > for EventWriterFetch < ' a , T > {
24
+ impl < ' a , T : Component > Fetch < ' a > for EventWriterFetch < T > {
25
25
/// EventWriter queries return an EventWriter<T> in each item
26
26
type Item = EventWriter < ' a , T > ;
27
27
/// This is the corresponding S: FetchState type
28
28
type State = EventWriterState < T > ;
29
29
30
30
/// Checks the storage type of the corresponding Events<T> component
31
31
fn is_dense ( & self ) -> bool {
32
- match self . state . event_storage_type {
32
+ match self . storage_type {
33
33
StorageType :: SparseSet => false ,
34
34
StorageType :: Table => true ,
35
35
}
@@ -48,7 +48,11 @@ impl<'a, T: Component> Fetch<'a> for EventWriterFetch<'a, T> {
48
48
last_change_tick,
49
49
change_tick,
50
50
) ,
51
- state,
51
+ storage_type : world
52
+ . components
53
+ . get_info ( world. components . get_id ( TypeId :: of :: < Events < T > > ( ) ) . unwrap ( ) )
54
+ . unwrap ( )
55
+ . storage_type ( ) ,
52
56
}
53
57
}
54
58
0 commit comments