From e0422d1390fd525d73cb13690f7fd38823ce10ab Mon Sep 17 00:00:00 2001 From: GsLogiMaker Date: Thu, 5 Dec 2024 19:46:54 -0600 Subject: [PATCH] Update docs --- cpp/src/doc_classes/GFComponent.xml | 39 ++++++++++++++++++- cpp/src/doc_classes/GFEntity.xml | 38 ++++++++++++++++++- cpp/src/doc_classes/GFModule.xml | 44 ++++++++++++++++++++++ cpp/src/doc_classes/GFObserverBuilder.xml | 3 +- cpp/src/doc_classes/GFPair.xml | 5 ++- cpp/src/doc_classes/GFQueryBuilder.xml | 3 +- cpp/src/doc_classes/GFQueryIterator.xml | 11 +++--- cpp/src/doc_classes/GFQuerylikeBuilder.xml | 42 ++++++++++++++++++++- cpp/src/doc_classes/GFWorld.xml | 10 +++++ 9 files changed, 182 insertions(+), 13 deletions(-) create mode 100644 cpp/src/doc_classes/GFModule.xml diff --git a/cpp/src/doc_classes/GFComponent.xml b/cpp/src/doc_classes/GFComponent.xml index e61f0c1..1f9cd61 100644 --- a/cpp/src/doc_classes/GFComponent.xml +++ b/cpp/src/doc_classes/GFComponent.xml @@ -1,5 +1,6 @@ - + A reference to a Glecs component from a [GFWorld] that is attatached to an entity. @@ -23,6 +24,36 @@ [/codeblock] + + + + + + + Overrides [method GFEntity.from()]. + + + + + + + + + Overrides [method GFEntity.from_id()]. + + + + + + Returns the memory alignment of this component's data. + + + + + + Returns the size in bytes of this component's data. + + @@ -65,6 +96,12 @@ [/codeblock] + + + + Overrides [method GFEntity.is_alive()]. + + diff --git a/cpp/src/doc_classes/GFEntity.xml b/cpp/src/doc_classes/GFEntity.xml index a146cf5..58f0341 100644 --- a/cpp/src/doc_classes/GFEntity.xml +++ b/cpp/src/doc_classes/GFEntity.xml @@ -1,5 +1,6 @@ - + A reference to an entity from a [GFWorld]. @@ -39,6 +40,31 @@ This method returns [code]self[/code] for chaining. + + + + + Adds a tag to this entity. + [codeblock] + var carnivore:= GFEntity.new().set_name("Carnivore") + var tiger:= GFEntity.new().set_name("Tiger") + + tiger.add_tag(carnivore) + [/codeblock] + + + + + + Deletes the entity this [GFEntity] is referencing. + [codeblock] + var entity:= GFEntity.new() + entity.is_alive() # true + entity.delete() + entity.is_alive() # false + [/codeblock] + + @@ -113,6 +139,16 @@ [/codeblock] + + + + Returns this entity's path in the tree. + [codeblock] + var entity:= GFGlobalWorld.lookup("flecs/core/OnAdd") + entity.get_path() == "flecs/core/OnAdd" + [/codeblock] + + diff --git a/cpp/src/doc_classes/GFModule.xml b/cpp/src/doc_classes/GFModule.xml new file mode 100644 index 0000000..0b2132e --- /dev/null +++ b/cpp/src/doc_classes/GFModule.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + Overrides [method GFEntity.from()]. + + + + + + + + Overrides [method GFEntity.from_id()]. + + + + + + + + Overrides [method GFEntity.new_in_world()]. + + + + + + + + Overrides [method GFEntity.new_named_in_world()]. + + + + diff --git a/cpp/src/doc_classes/GFObserverBuilder.xml b/cpp/src/doc_classes/GFObserverBuilder.xml index d354563..f1c6a86 100644 --- a/cpp/src/doc_classes/GFObserverBuilder.xml +++ b/cpp/src/doc_classes/GFObserverBuilder.xml @@ -1,6 +1,5 @@ - + A builder for observers. diff --git a/cpp/src/doc_classes/GFPair.xml b/cpp/src/doc_classes/GFPair.xml index a27f641..8ef1952 100644 --- a/cpp/src/doc_classes/GFPair.xml +++ b/cpp/src/doc_classes/GFPair.xml @@ -1,5 +1,6 @@ - + A reference to a pair of entity IDs. @@ -41,6 +42,7 @@ [codeblock] var IsAPrefab = GFPair.from("flecs/core/IsA", "flecs/core/Prefab") [/codeblock] + Overrides [method GFEntity.from()]. @@ -54,6 +56,7 @@ var second_id:= GFGlobalWorld.coerce_id("flecs/core/Prefab") var IsAPrefab = GFPair.from_id(GFGlobalWorld.pair_ids(first_id, second_id)) [/codeblock] + Overrides [method GFEntity.from_id()]. diff --git a/cpp/src/doc_classes/GFQueryBuilder.xml b/cpp/src/doc_classes/GFQueryBuilder.xml index 4d1c0f7..bfbabf9 100644 --- a/cpp/src/doc_classes/GFQueryBuilder.xml +++ b/cpp/src/doc_classes/GFQueryBuilder.xml @@ -1,6 +1,5 @@ - + A builder for queries. diff --git a/cpp/src/doc_classes/GFQueryIterator.xml b/cpp/src/doc_classes/GFQueryIterator.xml index faea4c1..e430cb0 100644 --- a/cpp/src/doc_classes/GFQueryIterator.xml +++ b/cpp/src/doc_classes/GFQueryIterator.xml @@ -1,5 +1,6 @@ - + An iterator over queried entities. @@ -7,12 +8,12 @@ The example below shows iteration of a query over entities with the Vector2 component: [codeblock] var query:GFQuery = GFGlobalWorld.query_builder() \ - .with("glecs/meta/Vector2") \ - .build() + .with("glecs/meta/Vector2") \ + .build() for terms:Array[GFComponent] in query.iterate(): - var vec2_c:= terms[0] - print("X: %s, Y %s" % [vec2_c.getm("x"), vec2_c.getm("y")]) + var vec2_c:= terms[0] + print("X: %s, Y %s" % [vec2_c.getm("x"), vec2_c.getm("y")]) [/codeblock] diff --git a/cpp/src/doc_classes/GFQuerylikeBuilder.xml b/cpp/src/doc_classes/GFQuerylikeBuilder.xml index ca33a7c..4bf5191 100644 --- a/cpp/src/doc_classes/GFQuerylikeBuilder.xml +++ b/cpp/src/doc_classes/GFQuerylikeBuilder.xml @@ -1,5 +1,6 @@ - + The abstract base class for different query-like builders. @@ -9,6 +10,45 @@ https://www.flecs.dev/flecs/md_docs_2Queries + + + + Marks the last added term as default. + + + + + + Marks the last added term as a filter. + Filters will not trigger observers, but they + will still be required for them to match. + + + + + + Marks the last added term read only. + + + + + + Marks the last added term read and write. + + + + + + Marks the last added term as never accessed. This will also cause the + term to not be passed to systems, queryies, or observers. + + + + + + Marks the last added term write only. + + diff --git a/cpp/src/doc_classes/GFWorld.xml b/cpp/src/doc_classes/GFWorld.xml index e58b776..7fd54f6 100644 --- a/cpp/src/doc_classes/GFWorld.xml +++ b/cpp/src/doc_classes/GFWorld.xml @@ -52,6 +52,16 @@ [/codeblock] + + + + + Finds and returns an entity according to its path. + [codeblock] + GFGlobalWorld.lookup("glecs/meta/Vector2") + [/codeblock] + +