Skip to content

Commit bfc3eb9

Browse files
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>
1 parent e2c56f5 commit bfc3eb9

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/jecs.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,14 @@ export class World {
155155
*/
156156
target(entity: Entity, relation: Entity, index?: number): Entity | undefined;
157157

158+
/**
159+
* Gets an iterator for all targets of a relationship.
160+
* Returns an empty iterator if no matches are found.
161+
* @param entity The entity using a relationship pair.
162+
* @param relation The "relationship" component/tag
163+
*/
164+
targets(entity: Entity, relation: Entity): IterFn<[]>
165+
158166
/**
159167
* Deletes an entity (and its components/relationships) from the world entirely.
160168
* @param entity The entity to delete.

src/jecs.luau

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ export type World = {
254254
index: number?
255255
) -> Entity<unknown>?,
256256

257-
-- Gets an iterator for all viable targets of a relationship
257+
-- Gets an iterator for all targets of a relationship.
258+
-- Returns an empty iterator if no matches are found.
258259
targets: <T>(
259260
self: World,
260261
id: Entity<T> | number,

0 commit comments

Comments
 (0)