public ETTask <List <T> > FindAllByIndex <T>(string indexName, T entity) where T : ComponentWithId { var type = typeof(T); CacheBase cache = null; caches.TryGetValue(type, out cache); ETTaskCompletionSource <List <T> > tcs = new ETTaskCompletionSource <List <T> >(); CacheFindAllByIndexTask <T> task = ComponentFactory.Create <CacheFindAllByIndexTask <T>, CacheBase, Tuple <string, T>, ETTaskCompletionSource <List <T> > > (cache, new Tuple <string, T>(indexName, entity), tcs); this.tasks[(int)((ulong)task.Id % taskCount)].Add(task); return(tcs.Task); }
public override void Awake(CacheFindAllByIndexTask <ComponentWithId> self, CacheBase proxy, Tuple <string, ComponentWithId> para, ETTaskCompletionSource <List <ComponentWithId> > tcs) { self.proxy = proxy; self.Tcs = tcs; self.parameter = para; }