diff --git a/src/init.luau b/src/init.luau index bbb3393..3898676 100644 --- a/src/init.luau +++ b/src/init.luau @@ -921,9 +921,8 @@ function world_delete(world: World, entity: i53) entityIndex.sparse[entity] = nil end -local function world_contains(world: World, entity) - - return world.entityIndex.sparse[entity] +local function world_contains(world: World, entity): boolean + return world.entityIndex.sparse[entity] ~= nil end type CompatibleArchetype = { archetype: Archetype, indices: { number } } @@ -1541,6 +1540,9 @@ export type World = { parent: (self: World, entity: Entity) -> Entity, + --- Checks if the world contains the given entity + 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)