Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update documentation #42

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion cpp/src/doc_classes/GFComponent.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFComponent" inherits="GFRegisterableEntity" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFComponent" inherits="GFRegisterableEntity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
A reference to a Glecs component from a [GFWorld] that is attatached to an entity.
</brief_description>
Expand All @@ -23,6 +24,36 @@
[/codeblock]
</description>
</method>
<method name="from" qualifiers="static">
<return type="GFComponent" />
<param index="0" name="component" type="Variant" />
<param index="1" name="world" type="Variant" />
<param index="2" name="_unnamed_arg2" type="GFWorld" default="null" />
<description>
Overrides [method GFEntity.from()].
</description>
</method>
<method name="from_id" qualifiers="static">
<return type="GFComponent" />
<param index="0" name="id" type="int" />
<param index="1" name="world" type="int" />
<param index="2" name="_unnamed_arg2" type="GFWorld" default="null" />
<description>
Overrides [method GFEntity.from_id()].
</description>
</method>
<method name="get_data_alignment">
<return type="int" />
<description>
Returns the memory alignment of this component's data.
</description>
</method>
<method name="get_data_size">
<return type="int" />
<description>
Returns the size in bytes of this component's data.
</description>
</method>
<method name="get_source_entity">
<return type="GFEntity" />
<description>
Expand Down Expand Up @@ -65,6 +96,12 @@
[/codeblock]
</description>
</method>
<method name="is_alive">
<return type="bool" />
<description>
Overrides [method GFEntity.is_alive()].
</description>
</method>
<method name="setm">
<return type="void" />
<param index="0" name="member" type="String" />
Expand Down
38 changes: 37 additions & 1 deletion cpp/src/doc_classes/GFEntity.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFEntity" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFEntity" inherits="RefCounted"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
A reference to an entity from a [GFWorld].
</brief_description>
Expand Down Expand Up @@ -39,6 +40,31 @@
This method returns [code]self[/code] for chaining.
</description>
</method>
<method name="add_tag">
<return type="GFEntity" />
<param index="0" name="tag" type="Variant" />
<description>
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]
</description>
</method>
<method name="delete">
<return type="void" />
<description>
Deletes the entity this [GFEntity] is referencing.
[codeblock]
var entity:= GFEntity.new()
entity.is_alive() # true
entity.delete()
entity.is_alive() # false
[/codeblock]
</description>
</method>
<method name="from" qualifiers="static">
<return type="GFEntity" />
<param index="0" name="entity" type="Variant" />
Expand Down Expand Up @@ -113,6 +139,16 @@
[/codeblock]
</description>
</method>
<method name="get_path">
<return type="String" />
<description>
Returns this entity's path in the tree.
[codeblock]
var entity:= GFGlobalWorld.lookup("flecs/core/OnAdd")
entity.get_path() == "flecs/core/OnAdd"
[/codeblock]
</description>
</method>
<method name="get_world">
<return type="GFWorld" />
<description>
Expand Down
44 changes: 44 additions & 0 deletions cpp/src/doc_classes/GFModule.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFModule" inherits="GFRegisterableEntity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
</brief_description>
<description>
</description>
<tutorials>
</tutorials>
<methods>
<method name="from" qualifiers="static">
<return type="GFModule" />
<param index="0" name="module" type="Variant" />
<param index="1" name="world" type="GFWorld" default="null" />
<description>
Overrides [method GFEntity.from()].
</description>
</method>
<method name="from_id" qualifiers="static">
<return type="GFModule" />
<param index="0" name="module_id" type="int" />
<param index="1" name="world" type="GFWorld" default="null" />
<description>
Overrides [method GFEntity.from_id()].
</description>
</method>
<method name="new_in_world" qualifiers="static">
<return type="GFModule" />
<param index="0" name="world" type="String" />
<param index="1" name="_unnamed_arg1" type="GFWorld" />
<description>
Overrides [method GFEntity.new_in_world()].
</description>
</method>
<method name="new_named_in_world" qualifiers="static">
<return type="GFModule" />
<param index="0" name="name" type="String" />
<param index="1" name="world" type="GFWorld" />
<description>
Overrides [method GFEntity.new_named_in_world()].
</description>
</method>
</methods>
</class>
3 changes: 1 addition & 2 deletions cpp/src/doc_classes/GFObserverBuilder.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFObserverBuilder" inherits="GFQuerylikeBuilder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFObserverBuilder" inherits="GFQuerylikeBuilder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
A builder for observers.
</brief_description>
Expand Down
5 changes: 4 additions & 1 deletion cpp/src/doc_classes/GFPair.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFPair" inherits="GFEntity" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFPair" inherits="GFEntity"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
A reference to a pair of entity IDs.
</brief_description>
Expand Down Expand Up @@ -41,6 +42,7 @@
[codeblock]
var IsAPrefab = GFPair.from("flecs/core/IsA", "flecs/core/Prefab")
[/codeblock]
Overrides [method GFEntity.from()].
</description>
</method>
<method name="from_id" qualifiers="static">
Expand All @@ -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()].
</description>
</method>
<method name="from_ids" qualifiers="static">
Expand Down
3 changes: 1 addition & 2 deletions cpp/src/doc_classes/GFQueryBuilder.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFQueryBuilder" inherits="GFQuerylikeBuilder"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFQueryBuilder" inherits="GFQuerylikeBuilder" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
A builder for queries.
</brief_description>
Expand Down
11 changes: 6 additions & 5 deletions cpp/src/doc_classes/GFQueryIterator.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFQueryIterator" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFQueryIterator" inherits="RefCounted"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
An iterator over queried entities.
</brief_description>
<description>
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]
</description>
<tutorials>
Expand Down
42 changes: 41 additions & 1 deletion cpp/src/doc_classes/GFQuerylikeBuilder.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<class name="GFQuerylikeBuilder" inherits="RefCounted" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<class name="GFQuerylikeBuilder" inherits="RefCounted"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/godotengine/godot/master/doc/class.xsd">
<brief_description>
The abstract base class for different query-like builders.
</brief_description>
Expand All @@ -9,6 +10,45 @@
<link title="More on Flecs Queries">https://www.flecs.dev/flecs/md_docs_2Queries</link>
</tutorials>
<methods>
<method name="access_default">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term as default.
</description>
</method>
<method name="access_filter">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term as a filter.
Filters will not trigger observers, but they
will still be required for them to match.
</description>
</method>
<method name="access_in">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term read only.
</description>
</method>
<method name="access_inout">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term read and write.
</description>
</method>
<method name="access_none">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term as never accessed. This will also cause the
term to not be passed to systems, queryies, or observers.
</description>
</method>
<method name="access_out">
<return type="GFQuerylikeBuilder" />
<description>
Marks the last added term write only.
</description>
</method>
<method name="is_built">
<return type="bool" />
<description>
Expand Down
10 changes: 10 additions & 0 deletions cpp/src/doc_classes/GFWorld.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@
[/codeblock]
</description>
</method>
<method name="lookup">
<return type="GFEntity" />
<param index="0" name="path" type="String" />
<description>
Finds and returns an entity according to its path.
[codeblock]
GFGlobalWorld.lookup("glecs/meta/Vector2")
[/codeblock]
</description>
</method>
<method name="pair">
<return type="GFPair" />
<param index="0" name="first" type="Variant" />
Expand Down
Loading