diff --git a/jecs.luau b/jecs.luau index 1b59033e..46411b9d 100644 --- a/jecs.luau +++ b/jecs.luau @@ -1733,6 +1733,10 @@ end export type Id = Entity +type function ecs_entity_t(entity) + return entity:components()[2]:readproperty(types.singleton("__T")) +end + export type function Pair(first, second) local thing = first:components()[2] @@ -1806,42 +1810,14 @@ export type World = { contains: (self: World, entity: Entity) -> boolean, --- Searches the world for entities that match a given query - query: ((self: World, Id) -> Query) - & ((self: World, Id, Id) -> Query) - & ((self: World, Id, Id, Id) -> Query) - & ((self: World, Id, Id, Id, Id) -> Query) - & ((self: World, Id, Id, Id, Id, Id) -> Query) - & (( - self: World, - Id, - Id, - Id, - Id, - Id, - Id - ) -> Query) - & (( - self: World, - Id, - Id, - Id, - Id, - Id, - Id, - Id - ) -> Query) - & (( - self: World, - Id, - Id, - Id, - Id, - Id, - Id, - Id, - Id, - ...Id - ) -> Query), + query: ((World, A) -> Query>) + & ((World, A, B) -> Query, ecs_entity_t>) + & ((World, A, B, C) -> Query, ecs_entity_t, ecs_entity_t>) + & ((World, A, B, C, D) -> Query, ecs_entity_t, ecs_entity_t, ecs_entity_t>) + & ((World, A, B, C, D, E) -> Query, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t>) + & ((World, A, B, C, D, E, F) -> Query, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t>) + & ((World, A, B, C, D, E, F, G) -> Query, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t>) + & ((World, A, B, C, D, E, F, G, H) -> Query, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t, ecs_entity_t>) } return {