33use std:: { alloc:: Layout , any:: TypeId , mem:: size_of, ptr} ;
44
55use anyhow:: Context ;
6- use feather_ecs:: { DynamicQuery , DynamicQueryTypes , Ecs } ;
6+ use feather_ecs:: { Ecs } ;
77use feather_plugin_host_macros:: host_function;
88use quill_common:: {
99 component:: { ComponentVisitor , SerializationMethod } ,
@@ -44,14 +44,13 @@ struct WrittenComponentData {
4444/// `ComponentVisitor` implementation used to write
4545/// component data to plugin memory.
4646struct WriteComponentsVisitor < ' a > {
47- query : & ' a DynamicQuery < ' a > ,
4847 cx : & ' a PluginContext ,
4948 num_entities : usize ,
5049}
5150
5251impl < ' a > ComponentVisitor < anyhow:: Result < WrittenComponentData > > for WriteComponentsVisitor < ' a > {
5352 fn visit < T : Component > ( self ) -> anyhow:: Result < WrittenComponentData > {
54- let components = self . query . iter_component_slices ( TypeId :: of :: < T > ( ) ) ;
53+ let components = todo ! ( ) ;
5554
5655 // Write each component.
5756 // We use a different strategy depending
@@ -109,10 +108,7 @@ fn create_query_data(
109108 ecs : & Ecs ,
110109 types : & [ HostComponent ] ,
111110) -> anyhow:: Result < QueryData > {
112- let query_types: Vec < TypeId > = types. iter ( ) . copied ( ) . map ( HostComponent :: type_id) . collect ( ) ;
113- let query = ecs. query_dynamic ( DynamicQueryTypes :: new ( & query_types, & [ ] ) ) ;
114-
115- let num_entities = query. iter_entities ( ) . count ( ) ;
111+ let num_entities = todo ! ( ) ;
116112 if num_entities == 0 {
117113 return Ok ( QueryData {
118114 num_entities : 0 ,
@@ -126,7 +122,6 @@ fn create_query_data(
126122 let component_lens = cx. bump_allocate ( Layout :: array :: < u32 > ( types. len ( ) ) ?) ?;
127123 for ( i, & typ) in types. iter ( ) . enumerate ( ) {
128124 let data = typ. visit ( WriteComponentsVisitor {
129- query : & query,
130125 cx,
131126 num_entities,
132127 } ) ?;
@@ -138,8 +133,8 @@ fn create_query_data(
138133 }
139134
140135 let entities_ptr = cx. bump_allocate ( Layout :: array :: < EntityId > ( num_entities) ?) ?;
141- for ( i, entity) in query . iter_entities ( ) . enumerate ( ) {
142- let bits = entity. to_bits ( ) ;
136+ for ( i, entity) in todo ! ( ) . enumerate ( ) {
137+ let bits = entity. to_bits ( ) . get ( ) ;
143138 unsafe {
144139 cx. write_pod ( entities_ptr. cast ( ) . add ( i) , bits) ?;
145140 }
0 commit comments