From f031dcee8da4c46ee1c6150a97772439e646f445 Mon Sep 17 00:00:00 2001 From: Laptev Stanislav <42931743+dubalda@users.noreply.github.com> Date: Sun, 10 Aug 2025 19:12:50 +0300 Subject: [PATCH] docs(api): consolidate and clarify contains method documentation (#264) Remove duplicate contains method section and update description to be more precise about checking both entities and components. Also fix example code references to use contains instead of has for consistency. --- docs/api/world.md | 45 ++++----------------------------------------- 1 file changed, 4 insertions(+), 41 deletions(-) diff --git a/docs/api/world.md b/docs/api/world.md index b10c2f8..c75217e 100755 --- a/docs/api/world.md +++ b/docs/api/world.md @@ -355,46 +355,9 @@ This operation is the same as calling: world:target(entity, jecs.ChildOf, 0) ``` -## contains - -Checks if an entity or component (id) exists in the world. - -```luau -function World:contains( - entity: Entity, -): boolean -``` - -Example: - -::: code-group - -```luau [luau] -local entity = world:entity() -print(world:contains(entity)) -print(world:contains(1)) -print(world:contains(2)) - --- Outputs: --- true --- true --- false -``` - -```ts [typescript] -const entity = world.entity(); -print(world.contains(entity)); -print(world.contains(1)); -print(world.contains(2)); - -// Outputs: -// true -// true -// false -``` - ::: + ## remove Removes a component (ID) from an entity @@ -460,11 +423,11 @@ Example: ```luau [luau] local entity = world:entity() -print(world:has(entity)) +print(world:contains(entity)) world:delete(entity) -print(world:has(entity)) +print(world:contains(entity)) -- Outputs: -- true @@ -601,7 +564,7 @@ print(retrievedParent === parent) // true ## contains -Checks if an entity exists and is alive in the world. +Checks if an entity or component (id) exists and is alive in the world. ```luau function World:contains(