Skip to content

Commit

Permalink
Fix typo in example
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jul 2, 2022
1 parent 2aa70d6 commit a54eaed
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 7 additions & 1 deletion examples/c/entities/basics/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char *argv[]) {
ecs_set(ecs, bob, Position, {20, 30});

// Create another named entity
ecs_entity_t alice = ecs_set_name(ecs, 0, "Bob");
ecs_entity_t alice = ecs_set_name(ecs, 0, "Alice");
ecs_set(ecs, alice, Position, {10, 20});
ecs_add(ecs, alice, Walking);

Expand All @@ -52,4 +52,10 @@ int main(int argc, char *argv[]) {
}

return ecs_fini(ecs);

// Output
// {10.000000, 20.000000}
// [Position, Walking, (Identifier,Name)]
// Alice: {10.000000, 20.000000}
// Bob: {20.000000, 30.000000}
}
6 changes: 6 additions & 0 deletions examples/cpp/entities/basics/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,10 @@ int main(int, char *[]) {
ecs.each([](flecs::entity e, Position& p) {
std::cout << e.name() << ": {" << p.x << ", " << p.y << "}" << "\n";
});

// Output
// {10, 20}
// [Position, Walking, (Identifier,Name)]
// Alice: {10, 20}
// Bob: {20, 30}
}

0 comments on commit a54eaed

Please sign in to comment.