diff --git a/examples/cpp/entities/basics/src/main.cpp b/examples/cpp/entities/basics/src/main.cpp index eeae5548a..49d210d4c 100644 --- a/examples/cpp/entities/basics/src/main.cpp +++ b/examples/cpp/entities/basics/src/main.cpp @@ -11,7 +11,7 @@ int main(int, char *[]) { flecs::world ecs; // Create an entity with name Bob - auto bob = ecs.entity("Bob") + flecs::entity bob = ecs.entity("Bob") // The set operation finds or creates a component, and sets it. // Components are automatically registered with the world. .set({10, 20}) @@ -27,7 +27,7 @@ int main(int, char *[]) { bob.set({20, 30}); // Create another named entity - auto alice = ecs.entity("Alice") + flecs::entity alice = ecs.entity("Alice") .set({10, 20}); // Add a tag after entity is created diff --git a/examples/cpp/entities/hierarchy/src/main.cpp b/examples/cpp/entities/hierarchy/src/main.cpp index 9e1828cf3..99bc6ac80 100644 --- a/examples/cpp/entities/hierarchy/src/main.cpp +++ b/examples/cpp/entities/hierarchy/src/main.cpp @@ -33,7 +33,7 @@ int main(int, char *[]) { // Hierarchies use ECS relationships and the builtin flecs::ChildOf relationship to // create entities as children of other entities. - auto sun = ecs.entity("Sun") + flecs::entity sun = ecs.entity("Sun") .add() .set({1, 1}); @@ -47,12 +47,12 @@ int main(int, char *[]) { .add() .set({2, 2}); - auto earth = ecs.entity("Earth") + flecs::entity earth = ecs.entity("Earth") .child_of(sun) .add() .set({3, 3}); - auto moon = ecs.entity("Moon") + flecs::entity moon = ecs.entity("Moon") .child_of(earth) .add() .set({0.1, 0.1}); diff --git a/examples/cpp/entities/hooks/src/main.cpp b/examples/cpp/entities/hooks/src/main.cpp index a8ae36159..72b415b65 100644 --- a/examples/cpp/entities/hooks/src/main.cpp +++ b/examples/cpp/entities/hooks/src/main.cpp @@ -71,7 +71,7 @@ int main(int, char *[]) { flecs::log::set_level(0); - auto e = ecs.entity("Entity"); + flecs::entity e = ecs.entity("Entity"); flecs::log::push("e.add()"); e.add(); diff --git a/examples/cpp/entities/iterate_components/src/main.cpp b/examples/cpp/entities/iterate_components/src/main.cpp index c8b132cfe..d9007a5c6 100644 --- a/examples/cpp/entities/iterate_components/src/main.cpp +++ b/examples/cpp/entities/iterate_components/src/main.cpp @@ -55,7 +55,7 @@ void iterate_components(flecs::entity e) { int main(int, char *[]) { flecs::world ecs; - auto bob = ecs.entity() + flecs::entity bob = ecs.entity() .set({10, 20}) .set({1, 1}) .add() diff --git a/examples/cpp/entities/multi_set_get/src/main.cpp b/examples/cpp/entities/multi_set_get/src/main.cpp index 875568be4..2f0b03c9e 100644 --- a/examples/cpp/entities/multi_set_get/src/main.cpp +++ b/examples/cpp/entities/multi_set_get/src/main.cpp @@ -15,7 +15,7 @@ int main(int, char *[]) { flecs::world ecs; // Create new entity, set Position and Mass component - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set([](Position& p, Mass& m) { p.x = 10; p.y = 20; diff --git a/examples/cpp/entities/prefab/src/main.cpp b/examples/cpp/entities/prefab/src/main.cpp index 55fbb3342..3d04d3334 100644 --- a/examples/cpp/entities/prefab/src/main.cpp +++ b/examples/cpp/entities/prefab/src/main.cpp @@ -17,7 +17,7 @@ int main(int, char *[]) { flecs::world ecs; // Create a prefab hierarchy. - auto spaceship = ecs.prefab("Spaceship") + flecs::entity spaceship = ecs.prefab("Spaceship") // Add components to prefab entity as usual .set({50}) .set({50}) @@ -27,7 +27,7 @@ int main(int, char *[]) { // copy of the component. .override(); - auto freighter = ecs.prefab("Freighter") + flecs::entity freighter = ecs.prefab("Freighter") // Short for .add(flecs::IsA, spaceship). This ensures the entity // inherits all components from spaceship. .is_a(spaceship) @@ -35,7 +35,7 @@ int main(int, char *[]) { .set({100}) .set({100}); - auto mammoth_freighter = ecs.prefab("MammothFreighter") + flecs::entity mammoth_freighter = ecs.prefab("MammothFreighter") .is_a(freighter) .set({500}) .set({300}); @@ -50,7 +50,7 @@ int main(int, char *[]) { // Create a regular entity from a prefab. // The instance will have a private copy of the Position component, because // of the override in the spaceship entity. All other components are shared. - auto inst = ecs.entity("my_mammoth_freighter") + flecs::entity inst = ecs.entity("my_mammoth_freighter") .is_a(mammoth_freighter); // Inspect the type of the entity. This outputs: diff --git a/examples/cpp/explorer/src/main.cpp b/examples/cpp/explorer/src/main.cpp index eca1f534c..237fb0d80 100644 --- a/examples/cpp/explorer/src/main.cpp +++ b/examples/cpp/explorer/src/main.cpp @@ -20,10 +20,10 @@ int main(int argc, char *argv[]) { .member("value"); // Simple hierarchy - auto Sun = world.entity("Sun") + flecs::entity Sun = world.entity("Sun") .set({1.988500e31}); - auto Earth = world.scope(Sun).entity("Earth") + flecs::entity Earth = world.scope(Sun).entity("Earth") .set({5.9722e24}); world.scope(Earth).entity("Moon") diff --git a/examples/cpp/game_mechanics/inventory_system/src/main.cpp b/examples/cpp/game_mechanics/inventory_system/src/main.cpp index 8473f63f4..cb9e9a403 100644 --- a/examples/cpp/game_mechanics/inventory_system/src/main.cpp +++ b/examples/cpp/game_mechanics/inventory_system/src/main.cpp @@ -136,9 +136,9 @@ void transfer_item(flecs::entity container, flecs::entity item) { if (amt) { // If item has amount we need to check if the container already has an // item of this kind, and increase the value. - auto ecs = container.world(); - auto ik = item_kind(item); - auto dst_item = find_item_w_kind(container, ik); + flecs::world ecs = container.world(); + flecs::entity ik = item_kind(item); + flecs::entity dst_item = find_item_w_kind(container, ik); if (dst_item) { // If a matching item was found, increase its amount Amount *dst_amt = dst_item.get_mut(); @@ -302,14 +302,14 @@ int main(int, char *[]) { .set_override({ 20 }); // Create a loot box with items - auto loot_box = ecs.entity("Chest").add().with([&]{ + flecs::entity loot_box = ecs.entity("Chest").add().with([&]{ ecs.entity().is_a(); ecs.entity().is_a(); ecs.entity().add().set({ 30 }); }); // Create a player entity with an inventory - auto player = ecs.entity("Player").set({10}).add( + flecs::entity player = ecs.entity("Player").set({10}).add( ecs.entity().add().with([&]{ ecs.entity().add().set({ 20 }); }) diff --git a/examples/cpp/game_mechanics/scene_management/src/main.cpp b/examples/cpp/game_mechanics/scene_management/src/main.cpp index ff73cf177..31b9c63ee 100644 --- a/examples/cpp/game_mechanics/scene_management/src/main.cpp +++ b/examples/cpp/game_mechanics/scene_management/src/main.cpp @@ -30,8 +30,8 @@ void reset_scene(flecs::world& ecs) { void menu_scene(flecs::iter& it, size_t, ActiveScene) { std::cout << "\n>> ActiveScene has changed to `MenuScene`\n\n"; - auto ecs = it.world(); - auto scene = ecs.component(); + flecs::world ecs = it.world(); + flecs::entity scene = ecs.component(); reset_scene(ecs); @@ -48,8 +48,8 @@ void menu_scene(flecs::iter& it, size_t, ActiveScene) { void game_scene(flecs::iter& it, size_t, ActiveScene) { std::cout << "\n>> ActiveScene has changed to `GameScene`\n\n"; - auto ecs = it.world(); - auto scene = ecs.component(); + flecs::world ecs = it.world(); + flecs::entity scene = ecs.component(); reset_scene(ecs); diff --git a/examples/cpp/hello_world/src/main.cpp b/examples/cpp/hello_world/src/main.cpp index 1dc6ac8e9..a2ca8f800 100644 --- a/examples/cpp/hello_world/src/main.cpp +++ b/examples/cpp/hello_world/src/main.cpp @@ -28,7 +28,7 @@ int main(int, char *[]) { }); // Create an entity with name Bob, add Position and food preference - auto Bob = ecs.entity("Bob") + flecs::entity Bob = ecs.entity("Bob") .set(Position{0, 0}) .set(Velocity{1, 2}) .add(); diff --git a/examples/cpp/queries/basics/src/main.cpp b/examples/cpp/queries/basics/src/main.cpp index 27192ce7c..8afe14d50 100644 --- a/examples/cpp/queries/basics/src/main.cpp +++ b/examples/cpp/queries/basics/src/main.cpp @@ -14,7 +14,7 @@ int main(int, char *[]) { // Create a query for Position, Velocity. Queries are the fastest way to // iterate entities as they cache results. - auto q = ecs.query(); + flecs::query q = ecs.query(); // Create a few test entities for a Position, Velocity query ecs.entity("e1") diff --git a/examples/cpp/queries/change_tracking/src/main.cpp b/examples/cpp/queries/change_tracking/src/main.cpp index afa78e094..096bca59a 100644 --- a/examples/cpp/queries/change_tracking/src/main.cpp +++ b/examples/cpp/queries/change_tracking/src/main.cpp @@ -25,18 +25,19 @@ int main(int, char *[]) { // when query::changed() is called. // Each query has its own private dirty state which is reset only when the // query is iterated. - auto q_read = ecs.query(); + flecs::query q_read = ecs.query(); // Create a query that writes the component based on a Dirty state. - auto q_write = ecs.query_builder() - .term_at(1).up() // Only match Dirty from prefab - .instanced() // Instanced iteration is faster (see example) - .build(); + flecs::query q_write = + ecs.query_builder() + .term_at(1).up() // Only match Dirty from prefab + .instanced() // Instanced iteration is faster (see example) + .build(); // Create two prefabs with a Dirty component. We can use this to share a // single Dirty value for all entities in a table. - auto p1 = ecs.prefab("p1").set({false}); - auto p2 = ecs.prefab("p2").set({true}); + flecs::entity p1 = ecs.prefab("p1").set({false}); + flecs::entity p2 = ecs.prefab("p2").set({true}); // Create instances of p1 and p2. Because the entities have different // prefabs, they end up in different tables. diff --git a/examples/cpp/queries/group_by/src/main.cpp b/examples/cpp/queries/group_by/src/main.cpp index 5d965cc7b..9743f3bd5 100644 --- a/examples/cpp/queries/group_by/src/main.cpp +++ b/examples/cpp/queries/group_by/src/main.cpp @@ -55,7 +55,7 @@ int main() { ecs.component(); // Grouped query - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .group_by(group_by_relation) .build(); @@ -92,7 +92,7 @@ int main() { // q.iter([&](flecs::iter& it, Position *p) { - auto group = ecs.entity(it.group_id()); + flecs::entity group = ecs.entity(it.group_id()); std::cout << " - group " << group.path() << ": table [" << it.table().str() << "]\n"; diff --git a/examples/cpp/queries/group_by_callbacks/src/main.cpp b/examples/cpp/queries/group_by_callbacks/src/main.cpp index f5082ae74..a53318f75 100644 --- a/examples/cpp/queries/group_by_callbacks/src/main.cpp +++ b/examples/cpp/queries/group_by_callbacks/src/main.cpp @@ -38,7 +38,7 @@ int main() { ecs.component(); // Grouped query - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .group_by() // Callback invoked when a new group is created @@ -106,7 +106,7 @@ int main() { std::cout << "\n"; q.iter([&](flecs::iter& it, Position *p) { - auto group = ecs.entity(it.group_id()); + flecs::entity group = ecs.entity(it.group_id()); group_ctx *ctx = static_cast(q.group_ctx(group)); std::cout << " - group " << group.path() << ": table [" << it.table().str() << "]\n"; diff --git a/examples/cpp/queries/group_by_custom/src/main.cpp b/examples/cpp/queries/group_by_custom/src/main.cpp index daef15950..1396b3ef6 100644 --- a/examples/cpp/queries/group_by_custom/src/main.cpp +++ b/examples/cpp/queries/group_by_custom/src/main.cpp @@ -41,7 +41,7 @@ int main() { ecs.component(); // Grouped query - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .group_by(group_by_relation) .build(); @@ -78,7 +78,7 @@ int main() { // q.iter([&](flecs::iter& it, Position *p) { - auto group = ecs.entity(it.group_id()); + flecs::entity group = ecs.entity(it.group_id()); std::cout << " - group " << group.path() << ": table [" << it.table().str() << "]\n"; diff --git a/examples/cpp/queries/group_iter/src/main.cpp b/examples/cpp/queries/group_iter/src/main.cpp index 0f599acfa..ce4d676f1 100644 --- a/examples/cpp/queries/group_iter/src/main.cpp +++ b/examples/cpp/queries/group_iter/src/main.cpp @@ -72,14 +72,14 @@ int main() { .add() .add(); - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .group_by(group_by_relation) .build(); // Iterate all tables std::cout << "All tables:\n"; q.iter([&](flecs::iter& it) { - auto group = ecs.entity(it.group_id()); + flecs::entity group = ecs.entity(it.group_id()); std::cout << " - group " << group.path() << ": table [" << it.table().str() << "]\n"; }); @@ -89,7 +89,7 @@ int main() { // Only iterate entities in cell 1_0 std::cout << "Tables for cell 1_0:\n"; q.iter().set_group().iter([&](flecs::iter& it) { - auto group = ecs.entity(it.group_id()); + flecs::entity group = ecs.entity(it.group_id()); std::cout << " - group " << group.path() << ": table [" << it.table().str() << "]\n"; }); diff --git a/examples/cpp/queries/hierarchy/src/main.cpp b/examples/cpp/queries/hierarchy/src/main.cpp index 5ef4502bb..3f454705a 100644 --- a/examples/cpp/queries/hierarchy/src/main.cpp +++ b/examples/cpp/queries/hierarchy/src/main.cpp @@ -13,7 +13,7 @@ int main(int, char *[]) { flecs::world ecs; // Create a hierarchy. For an explanation see the entities/hierarchy example - auto sun = ecs.entity("Sun") + flecs::entity sun = ecs.entity("Sun") .add() .set({1, 1}); @@ -27,7 +27,7 @@ int main(int, char *[]) { .add() .set({2, 2}); - auto earth = ecs.entity("Earth") + flecs::entity earth = ecs.entity("Earth") .child_of(sun) .add() .set({3, 3}); @@ -39,21 +39,22 @@ int main(int, char *[]) { // Create a hierarchical query to compute the global position from the // local position and the parent position. - auto q = ecs.query_builder() - // Modify terms from template to make sure the query selects the - // local, world and parent position components. - .term_at(1).second() - .term_at(2).second() - .term_at(3).second() + flecs::query q = + ecs.query_builder() + // Modify terms from template to make sure the query selects the + // local, world and parent position components. + .term_at(1).second() + .term_at(2).second() + .term_at(3).second() - // Extend the 2nd query argument to select it from the parent - .term_at(2) - // Get from the parent, in breadth-first order (cascade) - .parent().cascade() - // Make term component optional so we also match the root (sun) - .optional() - // Finalize the query - .build(); + // Extend the 2nd query argument to select it from the parent + .term_at(2) + // Get from the parent, in breadth-first order (cascade) + .parent().cascade() + // Make term component optional so we also match the root (sun) + .optional() + // Finalize the query + .build(); // Do the transform q.iter([](flecs::iter& it, diff --git a/examples/cpp/queries/instancing/src/main.cpp b/examples/cpp/queries/instancing/src/main.cpp index 9069750d7..a153d495a 100644 --- a/examples/cpp/queries/instancing/src/main.cpp +++ b/examples/cpp/queries/instancing/src/main.cpp @@ -40,13 +40,14 @@ int main(int, char *[]) { // Create a query for Position, Velocity. We'll create a few entities that // have Velocity as owned and shared component. - auto q = ecs.query_builder() - .term_at(1).self() // Position must always be owned by the entity - .instanced() // create instanced query - .build(); + flecs::query q = + ecs.query_builder() + .term_at(1).self() // Position must always be owned by the entity + .instanced() // create instanced query + .build(); // Create a prefab with Velocity. Prefabs are not matched with queries. - auto prefab = ecs.prefab("p") + flecs::entity prefab = ecs.prefab("p") .set({1, 2}); // Create a few entities that own Position & share Velocity from the prefab. diff --git a/examples/cpp/queries/iter/src/main.cpp b/examples/cpp/queries/iter/src/main.cpp index 95fcf6b4b..5427c9373 100644 --- a/examples/cpp/queries/iter/src/main.cpp +++ b/examples/cpp/queries/iter/src/main.cpp @@ -17,7 +17,8 @@ int main(int, char *[]) { flecs::world ecs; // Create a query for Position, Velocity. - auto q = ecs.query(); + flecs::query q = + ecs.query(); // Create a few test entities for a Position, Velocity query ecs.entity("e1") diff --git a/examples/cpp/queries/singleton/src/main.cpp b/examples/cpp/queries/singleton/src/main.cpp index bcbd8d6c0..0746458d0 100644 --- a/examples/cpp/queries/singleton/src/main.cpp +++ b/examples/cpp/queries/singleton/src/main.cpp @@ -26,9 +26,10 @@ int main(int, char *[]) { world.entity("e3").set({0, 2}); // Create query that matches Gravity as singleton - auto q = world.query_builder() - .term_at(2).singleton() - .build(); + flecs::query q = + world.query_builder() + .term_at(2).singleton() + .build(); // In a query string expression you can use the $ shortcut for singletons: // Velocity, Gravity($) diff --git a/examples/cpp/queries/sorting/src/main.cpp b/examples/cpp/queries/sorting/src/main.cpp index c77b18571..c022f361a 100644 --- a/examples/cpp/queries/sorting/src/main.cpp +++ b/examples/cpp/queries/sorting/src/main.cpp @@ -28,21 +28,21 @@ int main(int argc, char *argv[]) { flecs::world ecs(argc, argv); // Create entities, set Position in random order - auto e = ecs.entity().set({1, 0}); + flecs::entity e = ecs.entity().set({1, 0}); ecs.entity().set({6, 0}); ecs.entity().set({2, 0}); ecs.entity().set({5, 0}); ecs.entity().set({4, 0}); // Create a sorted system - auto sys = ecs.system() + flecs::system sys = ecs.system() .order_by(compare_position) .each([](const Position &p) { std::cout << "{" << p.x << "," << p.y << "}" << std::endl; }); // Create a sorted query - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .order_by(compare_position) .build(); diff --git a/examples/cpp/queries/wildcards/src/main.cpp b/examples/cpp/queries/wildcards/src/main.cpp index d11372d7e..7a767980f 100644 --- a/examples/cpp/queries/wildcards/src/main.cpp +++ b/examples/cpp/queries/wildcards/src/main.cpp @@ -15,7 +15,7 @@ int main(int, char *[]) { flecs::world ecs; // Create a query that matches edible components - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .term_at(1).second(flecs::Wildcard) // Change first argument to (Eats, *) .build(); @@ -30,8 +30,8 @@ int main(int, char *[]) { // Iterate the query with a flecs::iter. This makes it possible to inspect // the pair that we are currently matched with. q.each([](flecs::iter& it, size_t index, Eats& eats) { - auto e = it.entity(index); - auto food = it.pair(1).second(); + flecs::entity e = it.entity(index); + flecs::entity food = it.pair(1).second(); std::cout << e.name() << " eats " << eats.amount << " " << food.name() << std::endl; diff --git a/examples/cpp/queries/with/src/main.cpp b/examples/cpp/queries/with/src/main.cpp index 94c179118..d2a321fb4 100644 --- a/examples/cpp/queries/with/src/main.cpp +++ b/examples/cpp/queries/with/src/main.cpp @@ -15,7 +15,7 @@ int main(int, char *[]) { // result does not become part of the function signatures of each and iter. // This is useful for things like tags, which because they don't have a // value are less useful to pass to the each/iter functions as argument. - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .with() .build(); diff --git a/examples/cpp/queries/without/src/main.cpp b/examples/cpp/queries/without/src/main.cpp index 8402fdbf3..651979a02 100644 --- a/examples/cpp/queries/without/src/main.cpp +++ b/examples/cpp/queries/without/src/main.cpp @@ -18,7 +18,7 @@ int main(int, char *[]) { // // The without method is short for: // .term().not_() - auto q = ecs.query_builder() + flecs::query q = ecs.query_builder() .without() .build(); diff --git a/examples/cpp/reflection/basics/src/main.cpp b/examples/cpp/reflection/basics/src/main.cpp index 1901c1ed6..767d3b7dd 100644 --- a/examples/cpp/reflection/basics/src/main.cpp +++ b/examples/cpp/reflection/basics/src/main.cpp @@ -15,7 +15,7 @@ int main(int, char *[]) { .member("y"); // Create entity with Position as usual - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({10, 20}); // Convert position component to flecs expression string diff --git a/examples/cpp/reflection/basics_bitmask/src/main.cpp b/examples/cpp/reflection/basics_bitmask/src/main.cpp index c61e8fc6a..35c5f289f 100644 --- a/examples/cpp/reflection/basics_bitmask/src/main.cpp +++ b/examples/cpp/reflection/basics_bitmask/src/main.cpp @@ -24,7 +24,7 @@ int main(int, char *[]) { .member("toppings"); // Create entity with Position as usual - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({Toppings::Bacon | Toppings::Lettuce}); // Convert position component to flecs expression string diff --git a/examples/cpp/reflection/basics_deserialize/src/main.cpp b/examples/cpp/reflection/basics_deserialize/src/main.cpp index e90a09675..71c48fe5d 100644 --- a/examples/cpp/reflection/basics_deserialize/src/main.cpp +++ b/examples/cpp/reflection/basics_deserialize/src/main.cpp @@ -15,10 +15,10 @@ int main(int, char *[]) { .member("y"); // Create entity, set value of position using reflection API - auto e = ecs.entity(); + flecs::entity e = ecs.entity(); Position *ptr = e.get_mut(); - auto cur = ecs.cursor(ptr); + flecs::cursor cur = ecs.cursor(ptr); cur.push(); // { cur.set_float(10.0); // 10 cur.next(); // , diff --git a/examples/cpp/reflection/basics_enum/src/main.cpp b/examples/cpp/reflection/basics_enum/src/main.cpp index 7ec4e47ba..7c44ce4a8 100644 --- a/examples/cpp/reflection/basics_enum/src/main.cpp +++ b/examples/cpp/reflection/basics_enum/src/main.cpp @@ -24,7 +24,7 @@ int main(int, char *[]) { .member("color"); // Create entity with Position as usual - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({Green}); // Convert position component to flecs expression string diff --git a/examples/cpp/reflection/basics_json/src/main.cpp b/examples/cpp/reflection/basics_json/src/main.cpp index c45fb9bf4..3a1c5a690 100644 --- a/examples/cpp/reflection/basics_json/src/main.cpp +++ b/examples/cpp/reflection/basics_json/src/main.cpp @@ -15,7 +15,7 @@ int main(int, char *[]) { .member("y"); // Create entity with Position as usual - auto e = ecs.entity("ent") + flecs::entity e = ecs.entity("ent") .set({10, 20}); // Convert position component to JSON string diff --git a/examples/cpp/reflection/entity_type/src/main.cpp b/examples/cpp/reflection/entity_type/src/main.cpp index c41b4b02a..22c51b154 100644 --- a/examples/cpp/reflection/entity_type/src/main.cpp +++ b/examples/cpp/reflection/entity_type/src/main.cpp @@ -13,10 +13,10 @@ int main(int, char *[]) { ecs.component() .member(flecs::Entity, "e"); - auto foo = ecs.entity("Foo"); + flecs::entity foo = ecs.entity("Foo"); // Create entity with PortableType - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({ foo }); // Convert PortableType component to flecs expression string diff --git a/examples/cpp/reflection/nested_set_member/src/main.cpp b/examples/cpp/reflection/nested_set_member/src/main.cpp index 204993393..877bce504 100644 --- a/examples/cpp/reflection/nested_set_member/src/main.cpp +++ b/examples/cpp/reflection/nested_set_member/src/main.cpp @@ -23,10 +23,10 @@ int main(int, char *[]) { .member("stop"); // Create entity, set value of Line using reflection API - auto e = ecs.entity(); + flecs::entity e = ecs.entity(); Line *ptr = e.get_mut(); - auto cur = ecs.cursor(ptr); + flecs::cursor cur = ecs.cursor(ptr); cur.push(); // { cur.member("start"); // start: cur.push(); // { diff --git a/examples/cpp/reflection/nested_struct/src/main.cpp b/examples/cpp/reflection/nested_struct/src/main.cpp index 5d0a93136..ff150d71b 100644 --- a/examples/cpp/reflection/nested_struct/src/main.cpp +++ b/examples/cpp/reflection/nested_struct/src/main.cpp @@ -24,7 +24,7 @@ int main(int, char *[]) { .member("stop"); // Create entity with Position as usual - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({{10, 20}, {30, 40}}); // Convert position component to flecs expression string diff --git a/examples/cpp/reflection/portable_type/src/main.cpp b/examples/cpp/reflection/portable_type/src/main.cpp index a2b298b63..4d617c7c1 100644 --- a/examples/cpp/reflection/portable_type/src/main.cpp +++ b/examples/cpp/reflection/portable_type/src/main.cpp @@ -19,7 +19,7 @@ int main(int, char *[]) { .member(flecs::Uptr, "intptr"); // Create entity with PortableType - auto e = ecs.entity() + flecs::entity e = ecs.entity() .set({10, 20}); // Convert PortableType component to flecs expression string diff --git a/examples/cpp/reflection/query_to_custom_json/src/main.cpp b/examples/cpp/reflection/query_to_custom_json/src/main.cpp index 7a023f926..63fd4ed7a 100644 --- a/examples/cpp/reflection/query_to_custom_json/src/main.cpp +++ b/examples/cpp/reflection/query_to_custom_json/src/main.cpp @@ -38,7 +38,8 @@ int main(int, char *[]) { ecs.entity("d").set({30, 40}).set({4, 5}).set({20}); // Query for components - auto q = ecs.query(); + flecs::query q = + ecs.query(); // Serialize query to JSON. Customize serializer to only serialize entity // names and component values. diff --git a/examples/cpp/reflection/query_to_json/src/main.cpp b/examples/cpp/reflection/query_to_json/src/main.cpp index f6ff4d429..4b73eed2d 100644 --- a/examples/cpp/reflection/query_to_json/src/main.cpp +++ b/examples/cpp/reflection/query_to_json/src/main.cpp @@ -36,7 +36,8 @@ int main(int, char *[]) { ecs.entity("d").set({30, 40}).set({4, 5}).set({20}); // Query for components - auto q = ecs.query(); + flecs::query q = + ecs.query(); // Serialize query to JSON. Note that this works for any iterable object, // including filters & rules. diff --git a/examples/cpp/reflection/runtime_component/src/main.cpp b/examples/cpp/reflection/runtime_component/src/main.cpp index 58e8410ad..cfd8a0c15 100644 --- a/examples/cpp/reflection/runtime_component/src/main.cpp +++ b/examples/cpp/reflection/runtime_component/src/main.cpp @@ -5,15 +5,15 @@ int main(int, char *[]) { flecs::world ecs; // Create component for a type that isn't known at compile time - auto position = ecs.component("Position") + flecs::entity position = ecs.component("Position") .member("x") .member("y"); // Create entity, set value of position using reflection API - auto e = ecs.entity(); + flecs::entity e = ecs.entity(); void *ptr = e.get_mut(position); - auto cur = ecs.cursor(position, ptr); + flecs::cursor cur = ecs.cursor(position, ptr); cur.push(); cur.set_float(10); cur.next(); diff --git a/examples/cpp/reflection/runtime_nested_component/src/main.cpp b/examples/cpp/reflection/runtime_nested_component/src/main.cpp index 9fa0bf491..9e41c41a3 100644 --- a/examples/cpp/reflection/runtime_nested_component/src/main.cpp +++ b/examples/cpp/reflection/runtime_nested_component/src/main.cpp @@ -5,19 +5,19 @@ int main(int, char *[]) { flecs::world ecs; // Create components for types that aren't known at compile time - auto point = ecs.component("Point") + flecs::entity point = ecs.component("Point") .member("x") .member("y"); - auto line = ecs.component("Line") + flecs::entity line = ecs.component("Line") .member(point, "start") .member(point, "stop"); // Create entity, set value of position using reflection API - auto e = ecs.entity(); + flecs::entity e = ecs.entity(); void *ptr = e.get_mut(line); - auto cur = ecs.cursor(line, ptr); + flecs::cursor cur = ecs.cursor(line, ptr); cur.push(); // { cur.push(); // { cur.set_float(10); // 10 diff --git a/examples/cpp/reflection/units/src/main.cpp b/examples/cpp/reflection/units/src/main.cpp index d2713bc95..b3b2b9d7a 100644 --- a/examples/cpp/reflection/units/src/main.cpp +++ b/examples/cpp/reflection/units/src/main.cpp @@ -30,11 +30,11 @@ int main(int, char *[]) { .member("pressure") .member("precipitation"); - auto e = ecs.entity().set({24, 1.2, 0.5}); + flecs::entity e = ecs.entity().set({24, 1.2, 0.5}); // Use cursor API to print values with units WeatherStation *ptr = e.get_mut(); - auto cur = ecs.cursor(ptr); + flecs::cursor cur = ecs.cursor(ptr); cur.push(); print_value(cur); cur.next(); diff --git a/examples/cpp/relationships/basics/src/main.cpp b/examples/cpp/relationships/basics/src/main.cpp index d62fd75c2..9b8069689 100644 --- a/examples/cpp/relationships/basics/src/main.cpp +++ b/examples/cpp/relationships/basics/src/main.cpp @@ -8,15 +8,15 @@ int main(int, char*[]) { flecs::world ecs; // Entity used for Grows relationship - auto grows = ecs.entity("Grows"); + flecs::entity grows = ecs.entity("Grows"); // Relationship objects - auto apples = ecs.entity("Apples"); - auto pears = ecs.entity("Pears"); + flecs::entity apples = ecs.entity("Apples"); + flecs::entity pears = ecs.entity("Pears"); // Create an entity with 3 relationships. Relationships are like regular components, // but combine two types/identifiers into an (relationship, object) pair. - auto bob = ecs.entity("Bob") + flecs::entity bob = ecs.entity("Bob") // Pairs can be constructed from a type and entity .add(apples) .add(pears) diff --git a/examples/cpp/relationships/enum_relations/src/main.cpp b/examples/cpp/relationships/enum_relations/src/main.cpp index 4437293e0..8268af7f7 100644 --- a/examples/cpp/relationships/enum_relations/src/main.cpp +++ b/examples/cpp/relationships/enum_relations/src/main.cpp @@ -32,7 +32,7 @@ int main(int, char *[]) { flecs::world ecs; // Create an entity with (Tile, Stone) and (TileStatus, Free) relationships - auto tile = ecs.entity() + flecs::entity tile = ecs.entity() .add(Tile::Stone) .add(TileStatus::Free); @@ -62,7 +62,7 @@ int main(int, char *[]) { .term(flecs::Wildcard) .build() .each([&](flecs::iter& it, size_t) { - auto tile_constant = it.pair(1).second(); + flecs::entity tile_constant = it.pair(1).second(); printf("%s\n", tile_constant.path().c_str()); }); @@ -77,7 +77,7 @@ int main(int, char *[]) { .term(TileStatus::Occupied) .build() .each([&](flecs::iter& it, size_t) { - auto tile_constant = it.pair(1).second(); + flecs::entity tile_constant = it.pair(1).second(); printf("%s\n", tile_constant.path().c_str()); }); diff --git a/examples/cpp/relationships/exclusive_relations/src/main.cpp b/examples/cpp/relationships/exclusive_relations/src/main.cpp index 373424587..d8223dfd0 100644 --- a/examples/cpp/relationships/exclusive_relations/src/main.cpp +++ b/examples/cpp/relationships/exclusive_relations/src/main.cpp @@ -13,11 +13,11 @@ int main(int, char*[]) { .add(flecs::Exclusive); // Create two platoons - auto platoon_1 = ecs.entity(); - auto platoon_2 = ecs.entity(); + flecs::entity platoon_1 = ecs.entity(); + flecs::entity platoon_2 = ecs.entity(); // Create a unit - auto unit = ecs.entity(); + flecs::entity unit = ecs.entity(); // Add unit to platoon 1 unit.add(platoon_1); diff --git a/examples/cpp/relationships/relation_component/src/main.cpp b/examples/cpp/relationships/relation_component/src/main.cpp index 1e8ad7964..73d61c044 100644 --- a/examples/cpp/relationships/relation_component/src/main.cpp +++ b/examples/cpp/relationships/relation_component/src/main.cpp @@ -28,12 +28,12 @@ int main(int, char*[]) { // When one element of a pair is a component and the other element is a tag, // the pair assumes the type of the component. - auto e1 = ecs.entity().set({1.21}); + flecs::entity e1 = ecs.entity().set({1.21}); const Requires *r = e1.get(); std::cout << "requires: " << r->amount << std::endl; // The component can be either the first or second part of a pair: - auto e2 = ecs.entity().set({1.21}); + flecs::entity e2 = ecs.entity().set({1.21}); r = e2.get(); std::cout << "requires: " << r->amount << std::endl; @@ -42,7 +42,7 @@ int main(int, char*[]) { // If both parts of a pair are components, the pair assumes the type of // the first element: - auto e3 = ecs.entity().set({0.5}); + flecs::entity e3 = ecs.entity().set({0.5}); const Expires *e = e3.get(); std::cout << "expires: " << e->timeout << std::endl; @@ -62,8 +62,8 @@ int main(int, char*[]) { // When querying for a relationship component, add the pair type as template // argument to the builder: - auto q = ecs.query_builder() - .arg(1).second() // set second part of pair for first term + flecs::query q = ecs.query_builder() + .term_at(1).second() // set second part of pair for first term .build(); // When iterating, always use the pair type: diff --git a/examples/cpp/relationships/symmetric_relations/src/main.cpp b/examples/cpp/relationships/symmetric_relations/src/main.cpp index f94fda240..56a3329f2 100644 --- a/examples/cpp/relationships/symmetric_relations/src/main.cpp +++ b/examples/cpp/relationships/symmetric_relations/src/main.cpp @@ -13,8 +13,8 @@ int main(int, char*[]) { .add(flecs::Symmetric); // Create two players - auto player_1 = ecs.entity(); - auto player_2 = ecs.entity(); + flecs::entity player_1 = ecs.entity(); + flecs::entity player_2 = ecs.entity(); // Add (TradesWith, player_2) to player_1. This also adds // (TradesWith, player_1) to player_2. diff --git a/examples/cpp/relationships/union/src/main.cpp b/examples/cpp/relationships/union/src/main.cpp index a5366f474..9f5551714 100644 --- a/examples/cpp/relationships/union/src/main.cpp +++ b/examples/cpp/relationships/union/src/main.cpp @@ -36,7 +36,7 @@ int main(int argc, char *argv[]) { // Create a query that subscribes for all entities that have a Direction // and that are walking - auto q = ecs.query_builder() + flecs::query<> q = ecs.query_builder() .term(Walking) .term(flecs::Wildcard) .build(); @@ -50,7 +50,7 @@ int main(int argc, char *argv[]) { .add(Running) .add(Left); - auto e3 = ecs.entity("e3") + flecs::entity e3 = ecs.entity("e3") .add(Running) .add(Back); diff --git a/examples/cpp/rules/basics/src/main.cpp b/examples/cpp/rules/basics/src/main.cpp index 810f876bb..df065589d 100644 --- a/examples/cpp/rules/basics/src/main.cpp +++ b/examples/cpp/rules/basics/src/main.cpp @@ -7,11 +7,11 @@ struct Healthy { }; int main(int, char *[]) { flecs::world ecs; - auto Apples = ecs.entity("Apples").add(); - auto Salad = ecs.entity("Salad").add(); - auto Burgers = ecs.entity("Burgers"); - auto Pizza = ecs.entity("Pizza"); - auto Chocolate = ecs.entity("Chocolate"); + flecs::entity Apples = ecs.entity("Apples").add(); + flecs::entity Salad = ecs.entity("Salad").add(); + flecs::entity Burgers = ecs.entity("Burgers"); + flecs::entity Pizza = ecs.entity("Pizza"); + flecs::entity Chocolate = ecs.entity("Chocolate"); ecs.entity("Bob") .add(Apples) @@ -28,7 +28,7 @@ int main(int, char *[]) { // // Rules are similar to queries, but support more advanced features. This // example shows how the basics of how to use rules & variables. - auto r = ecs.rule_builder() + flecs::rule<> r = ecs.rule_builder() // Identifiers that start with _ are query variables. Query variables // are like wildcards, but enforce that the entity substituted by the // wildcard is the same across terms. @@ -39,10 +39,10 @@ int main(int, char *[]) { // // By replacing * with _Food, both terms are constrained to use the // same entity. - .term("$Food") - .term().src("$Food") + .with("$Food") + .with().src("$Food") .build(); - + // Lookup the index of the variable. This will let us quickly lookup its // value while we're iterating. int food_var = r.find_var("Food"); diff --git a/examples/cpp/rules/component_inheritance/src/main.cpp b/examples/cpp/rules/component_inheritance/src/main.cpp index 0f13a1bf5..2b6d718ad 100644 --- a/examples/cpp/rules/component_inheritance/src/main.cpp +++ b/examples/cpp/rules/component_inheritance/src/main.cpp @@ -41,7 +41,7 @@ int main(int, char *[]) { ecs.entity("builder_2").add(); // Create a rule to find all ranged units - auto r = ecs.rule(); + flecs::rule r = ecs.rule(); // Iterate the rule r.each([](flecs::entity e, RangedUnit) { diff --git a/examples/cpp/rules/cyclic_variables/src/main.cpp b/examples/cpp/rules/cyclic_variables/src/main.cpp index db72b62d1..01455da29 100644 --- a/examples/cpp/rules/cyclic_variables/src/main.cpp +++ b/examples/cpp/rules/cyclic_variables/src/main.cpp @@ -9,10 +9,10 @@ struct Likes { }; int main(int, char *[]) { flecs::world ecs; - auto bob = ecs.entity("Bob"); - auto alice = ecs.entity("Alice"); - auto john = ecs.entity("John"); - auto jane = ecs.entity("Jane"); + flecs::entity bob = ecs.entity("Bob"); + flecs::entity alice = ecs.entity("Alice"); + flecs::entity john = ecs.entity("John"); + flecs::entity jane = ecs.entity("Jane"); bob.add(alice); alice.add(bob); @@ -33,7 +33,7 @@ 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. - auto r = ecs.rule_builder() + flecs::rule<> r = ecs.rule_builder() .term("$Y").src("$X") .term("$X").src("$Y") .build(); @@ -46,8 +46,8 @@ int main(int, char *[]) { // Because the query doesn't use the This variable we cannot use "each" // which iterates the entities array. Instead we can use iter like this: r.iter([&](flecs::iter& it) { - auto x = it.get_var(x_var); - auto y = it.get_var(y_var); + flecs::entity x = it.get_var(x_var); + flecs::entity y = it.get_var(y_var); std::cout << x.name() << " likes " << y.name() << "\n"; }); diff --git a/examples/cpp/rules/facts/src/main.cpp b/examples/cpp/rules/facts/src/main.cpp index 6fbfaf54e..d5db2ebe6 100644 --- a/examples/cpp/rules/facts/src/main.cpp +++ b/examples/cpp/rules/facts/src/main.cpp @@ -24,10 +24,10 @@ struct Likes { }; int main(int, char *[]) { flecs::world ecs; - auto bob = ecs.entity("Bob"); - auto alice = ecs.entity("Alice"); - auto jane = ecs.entity("Jane"); - auto john = ecs.entity("John"); + flecs::entity bob = ecs.entity("Bob"); + flecs::entity alice = ecs.entity("Alice"); + flecs::entity jane = ecs.entity("Jane"); + flecs::entity john = ecs.entity("John"); bob.add(alice); alice.add(bob); @@ -46,7 +46,7 @@ int main(int, char *[]) { // Instead of using variables we could have created a rule that referred the // entities directly, but then we would have to create a rule for each // fact, vs reusing a single rule for multiple facts. - auto friends = ecs.rule_builder() + flecs::rule<> friends = ecs.rule_builder() .term("$Y").src("$X") .term("$X").src("$Y") .build(); diff --git a/examples/cpp/rules/setting_variables/src/main.cpp b/examples/cpp/rules/setting_variables/src/main.cpp index 7dea5e0d2..6d741a9f5 100644 --- a/examples/cpp/rules/setting_variables/src/main.cpp +++ b/examples/cpp/rules/setting_variables/src/main.cpp @@ -51,7 +51,7 @@ int main(int, char *[]) { player.add(); for (int pl = 0; pl < PlatoonsPerPlayer; pl ++) { - auto platoon = ecs.entity().add(player); + flecs::entity platoon = ecs.entity().add(player); // Add platoon tag so we can query for all platoons if we want to platoon.add(); @@ -70,7 +70,7 @@ int main(int, char *[]) { // The way to read how this query is evaluated is: // - find all entities with (Platoon, *), store * in _Platoon // - check if _Platoon has (Player, *), store * in _Player - auto r = ecs.rule_builder() + flecs::rule r = ecs.rule_builder() .term().second("$Platoon") .term("$Player").src("$Platoon") .build(); diff --git a/examples/cpp/rules/transitive_queries/src/main.cpp b/examples/cpp/rules/transitive_queries/src/main.cpp index 5b5d2528a..133e030ee 100644 --- a/examples/cpp/rules/transitive_queries/src/main.cpp +++ b/examples/cpp/rules/transitive_queries/src/main.cpp @@ -29,50 +29,50 @@ int main(int, char *[]) { ecs.component().add(flecs::Transitive); // Populate the store with locations - auto earth = ecs.entity("Earth") + flecs::entity earth = ecs.entity("Earth") .add(); // Continents - auto north_america = ecs.entity("NorthAmerica") + flecs::entity north_america = ecs.entity("NorthAmerica") .add() .add(earth); - auto europe = ecs.entity("Europe") + flecs::entity europe = ecs.entity("Europe") .add() .add(earth); // Countries - auto united_states = ecs.entity("UnitedStates") + flecs::entity united_states = ecs.entity("UnitedStates") .add() .add(north_america); - auto netherlands = ecs.entity("Netherlands") + flecs::entity netherlands = ecs.entity("Netherlands") .add() .add(europe); // States - auto california = ecs.entity("California") + flecs::entity california = ecs.entity("California") .add() .add(united_states); - auto washington = ecs.entity("Washington") + flecs::entity washington = ecs.entity("Washington") .add() .add(united_states); - auto noord_holland = ecs.entity("NoordHolland") + flecs::entity noord_holland = ecs.entity("NoordHolland") .add() .add(netherlands); // Cities - auto san_francisco = ecs.entity("SanFrancisco") + flecs::entity san_francisco = ecs.entity("SanFrancisco") .add() .add(california); - auto seattle = ecs.entity("Seattle") + flecs::entity seattle = ecs.entity("Seattle") .add() .add(washington); - auto amsterdam = ecs.entity("Amsterdam") + flecs::entity amsterdam = ecs.entity("Amsterdam") .add() .add(noord_holland); @@ -96,7 +96,7 @@ int main(int, char *[]) { // // The equivalent of this query in the DSL is: // Person, (LocatedIn, $Location), Country($Location) - auto r = ecs.rule_builder() + flecs::rule<> r = ecs.rule_builder() .term() .term("$Location") .term().src("$Location") diff --git a/examples/cpp/systems/custom_phases/src/main.cpp b/examples/cpp/systems/custom_phases/src/main.cpp index 8708445eb..c7aee7789 100644 --- a/examples/cpp/systems/custom_phases/src/main.cpp +++ b/examples/cpp/systems/custom_phases/src/main.cpp @@ -16,8 +16,13 @@ int main(int argc, char *argv[]) { // Create two custom phases that branch off of EcsOnUpdate. Note that the // phases have the Phase tag, which is necessary for the builtin pipeline // to discover which systems it should run. - auto Physics = ecs.entity().add(flecs::Phase).depends_on(flecs::OnUpdate); - auto Collisions = ecs.entity().add(flecs::Phase).depends_on(Physics); + flecs::entity Physics = ecs.entity() + .add(flecs::Phase) + .depends_on(flecs::OnUpdate); + + flecs::entity Collisions = ecs.entity() + .add(flecs::Phase) + .depends_on(Physics); // Create 3 dummy systems. ecs.system("CollisionSystem") diff --git a/examples/cpp/systems/custom_phases_no_builtin/src/main.cpp b/examples/cpp/systems/custom_phases_no_builtin/src/main.cpp index d99ff2a5a..af8d19fe6 100644 --- a/examples/cpp/systems/custom_phases_no_builtin/src/main.cpp +++ b/examples/cpp/systems/custom_phases_no_builtin/src/main.cpp @@ -16,9 +16,16 @@ int main(int argc, char *argv[]) { // Create three custom phases. Note that the phases have the Phase tag, // which is necessary for the builtin pipeline to discover which systems it // should run. - auto Update = ecs.entity().add(flecs::Phase); - auto Physics = ecs.entity().add(flecs::Phase).depends_on(Update); - auto Collisions = ecs.entity().add(flecs::Phase).depends_on(Physics); + flecs::entity Update = ecs.entity() + .add(flecs::Phase); + + flecs::entity Physics = ecs.entity() + .add(flecs::Phase) + .depends_on(Update); + + flecs::entity Collisions = ecs.entity() + .add(flecs::Phase) + .depends_on(Physics); // Create 3 dummy systems. ecs.system("CollisionSystem") diff --git a/examples/cpp/systems/custom_runner/src/main.cpp b/examples/cpp/systems/custom_runner/src/main.cpp index 1711ee8ad..158e6936d 100644 --- a/examples/cpp/systems/custom_runner/src/main.cpp +++ b/examples/cpp/systems/custom_runner/src/main.cpp @@ -19,7 +19,7 @@ struct Velocity { int main(int, char *[]) { flecs::world ecs; - auto s = ecs.system() + flecs::system s = ecs.system() // The run function has a signature that accepts a C iterator. By // forwarding the iterator to it->callback, the each function of the // system is invoked. diff --git a/examples/cpp/systems/mutate_entity/src/main.cpp b/examples/cpp/systems/mutate_entity/src/main.cpp index 6db1d5593..dcd39009b 100644 --- a/examples/cpp/systems/mutate_entity/src/main.cpp +++ b/examples/cpp/systems/mutate_entity/src/main.cpp @@ -24,7 +24,7 @@ int main(int, char *[]) { // When the entity to be mutated is not the same as the entity // provided by the system, an additional mut() call is required. // See the mutate_entity_handle example. - auto e = it.entity(index); + flecs::entity e = it.entity(index); e.destruct(); std::cout << "Expire: " << e.name() << "deleted!\n"; } @@ -45,7 +45,7 @@ int main(int, char *[]) { }); - auto e = ecs.entity("MyEntity") + flecs::entity e = ecs.entity("MyEntity") .set({3.0}); ecs.set_target_fps(1); diff --git a/examples/cpp/systems/mutate_entity_handle/src/main.cpp b/examples/cpp/systems/mutate_entity_handle/src/main.cpp index 7c4b51ee0..dc9de4865 100644 --- a/examples/cpp/systems/mutate_entity_handle/src/main.cpp +++ b/examples/cpp/systems/mutate_entity_handle/src/main.cpp @@ -60,7 +60,7 @@ int main(int, char *[]) { }); // Add Tag so we can get notified when entity is actually deleted - auto to_delete = ecs.entity("ToDelete") + flecs::entity to_delete = ecs.entity("ToDelete") .add(); ecs.entity("MyEntity") diff --git a/examples/cpp/systems/no_readonly/src/main.cpp b/examples/cpp/systems/no_readonly/src/main.cpp index e334b2f8c..3f5ddd827 100644 --- a/examples/cpp/systems/no_readonly/src/main.cpp +++ b/examples/cpp/systems/no_readonly/src/main.cpp @@ -21,7 +21,7 @@ int main(int, char *[]) { flecs::world ecs; // Create query to find all waiters without a plate - auto q_waiter = ecs.query_builder() + flecs::query<> q_waiter = ecs.query_builder() .term() .term(flecs::Wildcard).not_() .build(); diff --git a/examples/cpp/systems/system_ctx/src/main.cpp b/examples/cpp/systems/system_ctx/src/main.cpp index 221d03d8e..d7b81bb5a 100644 --- a/examples/cpp/systems/system_ctx/src/main.cpp +++ b/examples/cpp/systems/system_ctx/src/main.cpp @@ -33,7 +33,7 @@ int main(int, char *[]) { CollisionQuery q_collide = ecs.query(); - auto sys = ecs.system("Collide") + flecs::system sys = ecs.system("Collide") .ctx(&q_collide) .each([](flecs::iter& it, size_t i, const Position& p1, const Radius& r1) { CollisionQuery *q = it.ctx();