Struct ecs_observer_desc_t

Synopsis

#include <include/flecs.h>

typedef struct ecs_observer_desc_t

Description

Used with ecs_observer_init.

Mentioned in

Source

Lines 545-575 in include/flecs.h.

typedef struct ecs_observer_desc_t {
    /* Entity to associate with observer */
    ecs_entity_desc_t entity;

    /* Filter for observer */
    ecs_filter_desc_t filter;

    /* Events to observe (OnAdd, OnRemove, OnSet, UnSet) */
    ecs_entity_t events[ECS_TRIGGER_DESC_EVENT_COUNT_MAX];

    /* Callback to invoke on an event */
    ecs_iter_action_t callback;

    /* Associate with entity */
    ecs_entity_t self;

    /* User context to pass to callback */
    void *ctx;

    /* Context to be used for language bindings */
    void *binding_ctx;

    /* Callback to free ctx */
    ecs_ctx_free_t ctx_free;

    /* Callback to free binding_ctx */     
    ecs_ctx_free_t binding_ctx_free;

    /* Observable with which to register the trigger */
    ecs_poly_t *observable;  
} ecs_observer_desc_t;