mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 09:30:03 +00:00
Add types to world:has()
This commit is contained in:
parent
b4a10b10b9
commit
bc0a9bfe2c
1 changed files with 4 additions and 2 deletions
|
@ -669,7 +669,7 @@ do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local world_has: () -> boolean
|
local world_has: (world: World, entityId: number, ...i53) -> boolean
|
||||||
do
|
do
|
||||||
function world_has(world, entity_id, ...)
|
function world_has(world, entity_id, ...)
|
||||||
local id = entity_id
|
local id = entity_id
|
||||||
|
@ -1015,11 +1015,13 @@ export type WorldShim = typeof(setmetatable(
|
||||||
--- Removes a component from the given entity
|
--- Removes a component from the given entity
|
||||||
remove: (WorldShim, id: Entity, component: Entity) -> (),
|
remove: (WorldShim, id: Entity, component: Entity) -> (),
|
||||||
--- Retrieves the value of up to 4 components. These values may be nil.
|
--- Retrieves the value of up to 4 components. These values may be nil.
|
||||||
get: (<A>(WorldShim, id: any, Entity<A>) -> A)
|
get: (<A>(WorldShim, id: Entity, Entity<A>) -> A)
|
||||||
& (<A, B>(WorldShim, id: Entity, Entity<A>, Entity<B>) -> (A, B))
|
& (<A, B>(WorldShim, id: Entity, Entity<A>, Entity<B>) -> (A, B))
|
||||||
& (<A, B, C>(WorldShim, id: Entity, Entity<A>, Entity<B>, Entity<C>) -> (A, B, C))
|
& (<A, B, C>(WorldShim, id: Entity, Entity<A>, Entity<B>, Entity<C>) -> (A, B, C))
|
||||||
& <A, B, C, D>(WorldShim, id: Entity, Entity<A>, Entity<B>, Entity<C>, Entity<D>) -> (A, B, C, D),
|
& <A, B, C, D>(WorldShim, id: Entity, Entity<A>, Entity<B>, Entity<C>, Entity<D>) -> (A, B, C, D),
|
||||||
|
|
||||||
|
has: (WorldShim, Entity, ...Entity) -> boolean,
|
||||||
|
|
||||||
--- Searches the world for entities that match a given query
|
--- Searches the world for entities that match a given query
|
||||||
query: (<A>(WorldShim, Entity<A>) -> QueryShim<A>)
|
query: (<A>(WorldShim, Entity<A>) -> QueryShim<A>)
|
||||||
& (<A, B>(WorldShim, Entity<A>, Entity<B>) -> QueryShim<A, B>)
|
& (<A, B>(WorldShim, Entity<A>, Entity<B>) -> QueryShim<A, B>)
|
||||||
|
|
Loading…
Reference in a new issue