mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-24 17:10:03 +00:00
chore: Expose world:contains and query:drain in types
This commit is contained in:
parent
e7bbf08713
commit
ce70b1b2ee
1 changed files with 5 additions and 3 deletions
|
@ -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: (<A>(self: World, Id<A>) -> Query<A>)
|
||||
& (<A, B>(self: World, Id<A>, Id<B>) -> Query<A, B>)
|
||||
|
|
Loading…
Reference in a new issue