Skip to content

Commit

Permalink
#124 update amalgamated source
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Aug 13, 2021
1 parent 2a9a3e1 commit 8e9997f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 6 additions & 0 deletions flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -16601,6 +16601,12 @@ bool ecs_id_match(
return false;
}

bool ecs_id_is_pair(
ecs_id_t id)
{
return ECS_HAS_ROLE(id, PAIR);
}

bool ecs_id_is_wildcard(
ecs_id_t id)
{
Expand Down
15 changes: 12 additions & 3 deletions flecs.h
Original file line number Diff line number Diff line change
Expand Up @@ -6179,6 +6179,15 @@ bool ecs_id_match(
ecs_id_t id,
ecs_id_t pattern);

/** Utility to check if id is a pair.
*
* @param id The id.
* @return True if id is a pair.
*/
FLECS_API
bool ecs_id_is_pair(
ecs_id_t id);

/** Utility to check if id is a wildcard.
*
* @param id The id.
Expand Down Expand Up @@ -18119,19 +18128,19 @@ struct filter_invoker_no_ent<Func, arg_list<Args ...> >
};

// Switch between function with & without entity parameter
template<typename Func, bool V = true>
template<typename Func, typename T = int>
class filter_invoker;

template <typename Func>
class filter_invoker<Func, is_same<first_arg_t<Func>, flecs::entity>::value > {
class filter_invoker<Func, if_t<is_same<first_arg_t<Func>, flecs::entity>::value> > {
public:
filter_invoker(const flecs::world& world, Func&& func) {
filter_invoker_w_ent<Func, arg_list_t<Func>>(world, std::move(func));
}
};

template <typename Func>
class filter_invoker<Func, false == is_same<first_arg_t<Func>, flecs::entity>::value > {
class filter_invoker<Func, if_not_t<is_same<first_arg_t<Func>, flecs::entity>::value> > {
public:
filter_invoker(const flecs::world& world, Func&& func) {
filter_invoker_no_ent<Func, arg_list_t<Func>>(world, std::move(func));
Expand Down

0 comments on commit 8e9997f

Please sign in to comment.