From 623428f6762fdae5b47b2be18f67f0b0332ba7b1 Mon Sep 17 00:00:00 2001 From: Ukendio Date: Sun, 11 Aug 2024 03:24:28 +0200 Subject: [PATCH] Update docs --- docs/api/world.md | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/api/world.md b/docs/api/world.md index 8e3bb3e..cbedf2e 100644 --- a/docs/api/world.md +++ b/docs/api/world.md @@ -70,12 +70,21 @@ For example, a Health type should be created using this. ### get() ```luau -function World:get( +function World:get( entity: Entity, -- The entity - ...: Entity -- The types to fetch -): ... -- Returns the component data in the same order they were passed in + id: Entity -- The component ID to fetch +): T ``` -Returns the data for each provided type for the corresponding entity. +Returns the data for the component data the corresponding entity, nil if entity does not have the ID or was a tag. + +### has() +```luau +function World:has( + entity: Entity, -- The entity + id: Entity -- The component ID to check +): boolean +``` +Returns whether the entity has the ID. ::: @@ -109,7 +118,7 @@ Adds or changes the entity's component. ```luau function World:query( ...: Entity -- The IDs to query with -): Query -- Returns the Query +): Query ``` Creates a [`query`](query) with the given IDs. Entities that satisfies the conditions of the query will be returned and their corresponding data.