1#include <find_entity.h>
2#include <iostream>
3
4struct Position {
5 int x, y;
6};
7
8int main() {
10
11 ecs.
entity(
"e1").set<Position>({10, 20});
12 ecs.
entity(
"e2").set<Position>({20, 30});
13
14
16
17
19 return p.x == 20;
20 });
21
22 if (e) {
23 std::cout << "Found entity " << e.path() << std::endl;
24 } else {
25 std::cout << "No entity found" << std::endl;
26 }
27
28
29
30}
conditional_t< sizeof...(Args)==0 &&_::is_sparse_query< Comps... >::value, flecs::sparse_query< Comps... >, flecs::query< Comps... > > query(Args &&... args) const
Create a query.
flecs::entity entity(Args &&... args) const
Create an entity.