mirror of
https://github.com/Ukendio/jecs.git
synced 2026-05-13 14:24:14 +00:00
comments for world:targets (#312)
* docs for world:targets * Update src/jecs.d.ts Co-authored-by: dai <contact@daimond113.com> * remove world:targets() mention in 042_target.luau * ensure doc comments are same across files --------- Co-authored-by: dai <contact@daimond113.com>
This commit is contained in:
parent
e2c56f5420
commit
bfc3eb9980
2 changed files with 10 additions and 1 deletions
8
src/jecs.d.ts
vendored
8
src/jecs.d.ts
vendored
|
|
@ -155,6 +155,14 @@ export class World {
|
|||
*/
|
||||
target(entity: Entity, relation: Entity, index?: number): Entity | undefined;
|
||||
|
||||
/**
|
||||
* Gets an iterator for all targets of a relationship.
|
||||
* Returns an empty iterator if no matches are found.
|
||||
* @param entity The entity using a relationship pair.
|
||||
* @param relation The "relationship" component/tag
|
||||
*/
|
||||
targets(entity: Entity, relation: Entity): IterFn<[]>
|
||||
|
||||
/**
|
||||
* Deletes an entity (and its components/relationships) from the world entirely.
|
||||
* @param entity The entity to delete.
|
||||
|
|
|
|||
|
|
@ -254,7 +254,8 @@ export type World = {
|
|||
index: number?
|
||||
) -> Entity<unknown>?,
|
||||
|
||||
-- Gets an iterator for all viable targets of a relationship
|
||||
-- Gets an iterator for all targets of a relationship.
|
||||
-- Returns an empty iterator if no matches are found.
|
||||
targets: <T>(
|
||||
self: World,
|
||||
id: Entity<T> | number,
|
||||
|
|
|
|||
Loading…
Reference in a new issue