Skip to content

Commit

Permalink
Misc corrections to the docs (#1048)
Browse files Browse the repository at this point in the history
  • Loading branch information
999pingGG authored Sep 28, 2023
1 parent e97b171 commit e41500c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions docs/Relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -762,15 +762,15 @@ The following examples show how to use cleanup policies
```c
// Remove Archer from entities when Archer is deleted
ECS_TAG(world, Archer);
ecs_add_pair(world, EcsOnDelete, EcsRemove);
ecs_add_pair(world, Archer, EcsOnDelete, EcsRemove);

ecs_entity_t e = ecs_new_w_id(world, Archer);

// This will remove Archer from e
ecs_delete(world, Archer);
```
```cpp
// Delete entities with Archer when Archer is deleted
// Remove Archer from entities when Archer is deleted
world.component<Archer>()
.add(flecs::OnDelete, flecs::Remove);
Expand All @@ -784,7 +784,7 @@ world.component<Archer>().destruct();
```c
// Delete entities with Archer when Archer is deleted
ECS_TAG(world, Archer);
ecs_add_pair(world, EcsOnDelete, EcsDelete);
ecs_add_pair(world, Archer, EcsOnDelete, EcsDelete);

ecs_entity_t e = ecs_new_w_id(world, Archer);

Expand All @@ -806,7 +806,7 @@ world.component<Archer>().destruct();
```c
// Delete children when deleting parent
ECS_TAG(world, ChildOf);
ecs_add_pair(world, EcsOnDeleteTarget, EcsDelete);
ecs_add_pair(world, ChildOf, EcsOnDeleteTarget, EcsDelete);

ecs_entity_t p = ecs_new_id(world);
ecs_entity_t e = ecs_new_w_pair(world, ChildOf, p);
Expand Down
2 changes: 1 addition & 1 deletion examples/c/entities/iterate_components/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void iterate_components(ecs_world_t *ecs, ecs_entity_t e) {
ecs_os_free(type_str);

// 2. To print individual ids, iterate the type array with ecs_id_str
ecs_id_t *type_ids = type->array;
const ecs_id_t *type_ids = type->array;
int32_t i, count = type->count;

for (i = 0; i < count; i ++) {
Expand Down
2 changes: 1 addition & 1 deletion examples/c/prefabs/basics/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
//
// To get a private copy of a component, an instance can add it which is called
// an override. Overrides can be manual (by using add) or automatic (see the
// auto_override example).
// override example).
//
// If a prefab has children, adding the IsA relationship instantiates the prefab
// children for the instance (see hierarchy example).
Expand Down
2 changes: 1 addition & 1 deletion examples/c/prefabs/override/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int argc, char *argv[]) {

ecs_entity_t SpaceShip = ecs_new_prefab(ecs, "SpaceShip");

// Attack and Damage are properties that can be shared across many
// Attack and Defense are properties that can be shared across many
// spaceships. This saves memory, and speeds up prefab creation as we don't
// have to copy the values of Attack and Defense to private components.
ecs_set(ecs, SpaceShip, Attack, { 75 });
Expand Down
2 changes: 1 addition & 1 deletion examples/c/reflection/auto_define_enum/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int main(int argc, char *argv[]) {
ecs_world_t *ecs = ecs_init_w_args(argc, argv);

// Register both components. Note that Color is registered first, so that
// when Line is registered, the type information of Color can be looked up
// when Car is registered, the type information of Color can be looked up
ECS_META_COMPONENT(ecs, Color);
ECS_META_COMPONENT(ecs, Car);

Expand Down
4 changes: 2 additions & 2 deletions flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -5680,7 +5680,7 @@ void ecs_modified_id(
* @param world The world.
* @param entity The entity.
* @param id The id of the component to set.
* @param size The size of the pointer to the value.
* @param size The size of the pointed-to value.
* @param ptr The pointer to the value.
* @return The entity. A new entity if no entity was provided.
*/
Expand Down Expand Up @@ -11213,7 +11213,7 @@ ecs_entity_t ecs_system_init(
* Any system may interrupt execution by setting the interrupted_by member in
* the ecs_iter_t value. This is particularly useful for manual systems, where
* the value of interrupted_by is returned by this operation. This, in
* cominbation with the param argument lets applications use manual systems
* combination with the param argument lets applications use manual systems
* to lookup entities: once the entity has been found its handle is passed to
* interrupted_by, which is then subsequently returned.
*
Expand Down
2 changes: 1 addition & 1 deletion include/flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2883,7 +2883,7 @@ void ecs_modified_id(
* @param world The world.
* @param entity The entity.
* @param id The id of the component to set.
* @param size The size of the pointer to the value.
* @param size The size of the pointed-to value.
* @param ptr The pointer to the value.
* @return The entity. A new entity if no entity was provided.
*/
Expand Down

0 comments on commit e41500c

Please sign in to comment.