From bc0a9bfe2c54c0cf3aab38c9c36ce4fa3be0cbd4 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Fri, 26 Jul 2024 02:52:36 +0200 Subject: [PATCH] Add types to world:has() --- src/init.luau | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/init.luau b/src/init.luau index f86d1bd..faffba9 100644 --- a/src/init.luau +++ b/src/init.luau @@ -669,7 +669,7 @@ do end end -local world_has: () -> boolean +local world_has: (world: World, entityId: number, ...i53) -> boolean do function world_has(world, entity_id, ...) local id = entity_id @@ -1015,11 +1015,13 @@ export type WorldShim = typeof(setmetatable( --- Removes a component from the given entity remove: (WorldShim, id: Entity, component: Entity) -> (), --- Retrieves the value of up to 4 components. These values may be nil. - get: ((WorldShim, id: any, Entity) -> A) + get: ((WorldShim, id: Entity, Entity) -> A) & ((WorldShim, id: Entity, Entity, Entity) -> (A, B)) & ((WorldShim, id: Entity, Entity, Entity, Entity) -> (A, B, C)) & (WorldShim, id: Entity, Entity, Entity, Entity, Entity) -> (A, B, C, D), + has: (WorldShim, Entity, ...Entity) -> boolean, + --- Searches the world for entities that match a given query query: ((WorldShim, Entity) -> QueryShim) & ((WorldShim, Entity, Entity) -> QueryShim)