Skip to content

Commit

Permalink
Replace .term with .with
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Jul 10, 2023
1 parent 7b1ff54 commit 339d342
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion examples/cpp/game_mechanics/inventory_system/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ flecs::entity get_container(flecs::entity container) {
template <typename Func>
void for_each_item(flecs::entity container, const Func& func) {
container.world().filter_builder()
.term<ContainedBy>(container)
.with<ContainedBy>(container)
.build()
.each(func);
}
Expand Down
6 changes: 3 additions & 3 deletions examples/cpp/relationships/enum_relations/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int main(int, char *[]) {

// Iterate all entities with a Tile relationship
ecs.filter_builder()
.term<Tile>(flecs::Wildcard)
.with<Tile>(flecs::Wildcard)
.build()
.each([&](flecs::iter& it, size_t) {
flecs::entity tile_constant = it.pair(1).second();
Expand All @@ -73,8 +73,8 @@ int main(int, char *[]) {

// Iterate only occupied tiles
ecs.filter_builder()
.term<Tile>(flecs::Wildcard)
.term(TileStatus::Occupied)
.with<Tile>(flecs::Wildcard)
.with(TileStatus::Occupied)
.build()
.each([&](flecs::iter& it, size_t) {
flecs::entity tile_constant = it.pair(1).second();
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/relationships/union/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ int main(int argc, char *argv[]) {
// Create a query that subscribes for all entities that have a Direction
// and that are walking
flecs::query<> q = ecs.query_builder()
.term(Walking)
.term<Direction>(flecs::Wildcard)
.with(Walking)
.with<Direction>(flecs::Wildcard)
.build();

// Create a few entities with various state combinations
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rules/cyclic_variables/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ int main(int, char *[]) {
// Because this query does not use This at all, the entities array will not
// be populated, and it.count() will always be 0.
flecs::rule<> r = ecs.rule_builder()
.term<Likes>("$Y").src("$X")
.term<Likes>("$X").src("$Y")
.with<Likes>("$Y").src("$X")
.with<Likes>("$X").src("$Y")
.build();

// Lookup the index of the variables. This will let us quickly lookup their
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rules/facts/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ int main(int, char *[]) {
// entities directly, but then we would have to create a rule for each
// fact, vs reusing a single rule for multiple facts.
flecs::rule<> friends = ecs.rule_builder()
.term<Likes>("$Y").src("$X")
.term<Likes>("$X").src("$Y")
.with<Likes>("$Y").src("$X")
.with<Likes>("$X").src("$Y")
.build();

int x_var = friends.find_var("X");
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/rules/setting_variables/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ int main(int, char *[]) {
// - find all entities with (Platoon, *), store * in _Platoon
// - check if _Platoon has (Player, *), store * in _Player
flecs::rule<RangedUnit> r = ecs.rule_builder<RangedUnit>()
.term<Platoon>().second("$Platoon")
.term<Player>("$Player").src("$Platoon")
.with<Platoon>().second("$Platoon")
.with<Player>("$Player").src("$Platoon")
.build();

// If we would iterate this rule it would return all ranged units for all
Expand Down
6 changes: 3 additions & 3 deletions examples/cpp/rules/transitive_queries/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,9 @@ int main(int, char *[]) {
// The equivalent of this query in the DSL is:
// Person, (LocatedIn, $Location), Country($Location)
flecs::rule<> r = ecs.rule_builder()
.term<Person>()
.term<LocatedIn>("$Location")
.term<Country>().src("$Location")
.with<Person>()
.with<LocatedIn>("$Location")
.with<Country>().src("$Location")
.build();

// Lookup the index of the variable. This will let us quickly lookup its
Expand Down
4 changes: 2 additions & 2 deletions examples/cpp/systems/no_readonly/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ int main(int, char *[]) {

// Create query to find all waiters without a plate
flecs::query<> q_waiter = ecs.query_builder()
.term<Waiter>()
.term<Plate>(flecs::Wildcard).not_()
.with<Waiter>()
.without<Plate>(flecs::Wildcard)
.build();

// System that assigns plates to waiter. By making this system no_readonly
Expand Down

0 comments on commit 339d342

Please sign in to comment.