Alternative managed wrapper around flecs-cs bindings for using the ECS framework Flecs in modern .NET.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1754 lines
56 KiB

// <auto-generated>
// Generated by gaemstone.ECS.BindGen c661367
// Time: 2023-01-09 18:48:29Z
// Flecs version: v3.1.3
// </auto-generated>
using System.Runtime.InteropServices;
#pragma warning disable CS8981
public static unsafe partial class flecs
{
public struct ecs_vector_t { }
public struct ecs_sparse_t
{
public ecs_vector_t* dense;
public ecs_vector_t* chunks;
public int size;
public int count;
public ulong max_id_local;
public ulong* max_id;
public void* allocator;
public void* chunk_allocator;
}
public struct ecs_block_allocator_block_t
{
public void* memory;
public void* next;
}
public struct ecs_block_allocator_chunk_header_t
{
public void* next;
}
public struct ecs_block_allocator_t
{
public ecs_block_allocator_chunk_header_t* head;
public ecs_block_allocator_block_t* block_head;
public ecs_block_allocator_block_t* block_tail;
public int chunk_size;
public int data_size;
public int chunks_per_block;
public int block_size;
public int alloc_count;
}
public struct ecs_bucket_entry_t
{
public void* next;
public ecs_map_key_t key;
}
public struct ecs_bucket_t
{
public ecs_bucket_entry_t* first;
}
public struct ecs_map_t
{
public ecs_bucket_t* buckets;
public ecs_bucket_t* buckets_end;
public short elem_size;
public byte bucket_shift;
public bool shared_allocator;
public int bucket_count;
public int count;
public void* allocator;
public void* entry_allocator;
}
public struct ecs_map_iter_t
{
[Const] public ecs_map_t* map;
public ecs_bucket_t* bucket;
public ecs_bucket_entry_t* entry;
}
public struct ecs_map_params_t
{
public int size;
public void* allocator;
public ecs_block_allocator_t entry_allocator;
public int initial_count;
}
public struct ecs_allocator_t
{
public ecs_block_allocator_t chunks;
public ecs_sparse_t sizes;
}
public struct ecs_strbuf_element
{
public bool buffer_embedded;
public int pos;
public char* buf;
public void* next;
}
public struct ecs_strbuf_element_embedded
{
public ecs_strbuf_element super;
public fixed char buf[512];
}
public struct ecs_strbuf_element_str
{
public ecs_strbuf_element super;
public char* alloc_str;
}
public struct ecs_strbuf_list_elem
{
public int count;
[Const] public char* separator;
}
public struct ecs_strbuf_t
{
public char* buf;
public int max;
public int size;
public int elementCount;
public ecs_strbuf_element_embedded firstElement;
public ecs_strbuf_element* current;
public fixed ecs_strbuf_list_elem list_stack[32];
public int list_sp;
public char* content;
public int length;
}
public struct ecs_time_t
{
public uint sec;
public uint nanosec;
}
public struct ecs_os_api_t
{
public ecs_os_api_init_t init_;
public ecs_os_api_fini_t fini_;
public ecs_os_api_malloc_t malloc_;
public ecs_os_api_realloc_t realloc_;
public ecs_os_api_calloc_t calloc_;
public ecs_os_api_free_t free_;
public ecs_os_api_strdup_t strdup_;
public ecs_os_api_thread_new_t thread_new_;
public ecs_os_api_thread_join_t thread_join_;
public ecs_os_api_thread_self_t thread_self_;
public ecs_os_api_ainc_t ainc_;
public ecs_os_api_ainc_t adec_;
public ecs_os_api_lainc_t lainc_;
public ecs_os_api_lainc_t ladec_;
public ecs_os_api_mutex_new_t mutex_new_;
public ecs_os_api_mutex_free_t mutex_free_;
public ecs_os_api_mutex_lock_t mutex_lock_;
public ecs_os_api_mutex_lock_t mutex_unlock_;
public ecs_os_api_cond_new_t cond_new_;
public ecs_os_api_cond_free_t cond_free_;
public ecs_os_api_cond_signal_t cond_signal_;
public ecs_os_api_cond_broadcast_t cond_broadcast_;
public ecs_os_api_cond_wait_t cond_wait_;
public ecs_os_api_sleep_t sleep_;
public ecs_os_api_now_t now_;
public ecs_os_api_get_time_t get_time_;
public ecs_os_api_log_t log_;
public ecs_os_api_abort_t abort_;
public ecs_os_api_dlopen_t dlopen_;
public ecs_os_api_dlproc_t dlproc_;
public ecs_os_api_dlclose_t dlclose_;
public ecs_os_api_module_to_path_t module_to_dl_;
public ecs_os_api_module_to_path_t module_to_etc_;
public int log_level_;
public int log_indent_;
public int log_last_error_;
public long log_last_timestamp_;
public uint flags_;
}
/// <summary> An array with (component) ids. </summary>
public struct ecs_type_t
{
public ecs_id_t* array;
public int count;
}
public struct ecs_world_t { }
public struct ecs_table_t { }
public struct ecs_query_t { }
public struct ecs_rule_t { }
public struct ecs_id_record_t { }
public struct ecs_table_record_t { }
public struct ecs_mixins_t { }
/// <summary> Header for ecs_poly_t objects. </summary>
public struct ecs_header_t
{
public int magic;
public int type;
public ecs_mixins_t* mixins;
}
/// <summary> Iterable mixin. Allows its container to be iterated. </summary>
public struct ecs_iterable_t
{
public ecs_iter_init_action_t init;
}
/// <summary> Specify read/write access for term. </summary>
public enum ecs_inout_kind_t
{
EcsInOutDefault,
EcsInOutNone,
EcsInOut,
EcsIn,
EcsOut,
}
/// <summary> Specify operator for term. </summary>
public enum ecs_oper_kind_t
{
EcsAnd,
EcsOr,
EcsNot,
EcsOptional,
EcsAndFrom,
EcsOrFrom,
EcsNotFrom,
}
/// <summary> Type that describes a single identifier in a term. </summary>
public struct ecs_term_id_t
{
/// <summary> Entity id. If left to 0 and flags does not specify whether id is an entity or a variable the id will be initialized to EcsThis. To explicitly set the id to 0, leave the id member to 0 and set EcsIsEntity in flags. </summary>
public ecs_entity_t id;
/// <summary> Name. This can be either the variable name (when the EcsIsVariable flag is set) or an entity name. Entity names are used to initialize the id member during term finalization and will be freed when term.move is set to true. </summary>
public char* name;
/// <summary> Relationship to traverse when looking for the component. The relationship must have the Acyclic property. Default is IsA. </summary>
public ecs_entity_t trav;
/// <summary> Term flags. </summary>
public uint flags;
}
/// <summary> Type that describes a term (single element in a query). </summary>
public struct ecs_term_t
{
/// <summary> Component id to be matched by term. Can be set directly, or will be populated from the first/second members, which provide more flexibility. </summary>
public ecs_id_t id;
/// <summary> Source of term. </summary>
public ecs_term_id_t src;
/// <summary> Component or first element of pair. </summary>
public ecs_term_id_t first;
/// <summary> Second element of pair. </summary>
public ecs_term_id_t second;
/// <summary> Access to contents matched by term. </summary>
public ecs_inout_kind_t inout;
/// <summary> Operator of term. </summary>
public ecs_oper_kind_t oper;
/// <summary> Id flags of term id. </summary>
public ecs_id_t id_flags;
/// <summary> Name of term. </summary>
public char* name;
/// <summary> Index of field for term in iterator. </summary>
public int field_index;
/// <summary> Cached pointer to internal index. </summary>
public ecs_id_record_t* idr;
/// <summary> Used by internals. </summary>
public bool move;
}
/// <summary> Filters alllow for ad-hoc quick filtering of entity tables. </summary>
public struct ecs_filter_t
{
public ecs_header_t hdr;
/// <summary> Array containing terms for filter. </summary>
public ecs_term_t* terms;
/// <summary> Number of elements in terms array. </summary>
public int term_count;
/// <summary> Number of fields in iterator for filter. </summary>
public int field_count;
/// <summary> Is filter object owned by filter. </summary>
public bool owned;
/// <summary> Is terms array owned by filter. </summary>
public bool terms_owned;
/// <summary> Filter flags. </summary>
public uint flags;
/// <summary> Array with variable names. </summary>
public fixed char * variable_names[1];
/// <summary> Entity associated with filter (optional). </summary>
public ecs_entity_t entity;
public ecs_world_t* world;
/// <summary> Iterable mixin. </summary>
public ecs_iterable_t iterable;
/// <summary> Dtor mixin. </summary>
public ecs_poly_dtor_t dtor;
}
public struct ecs_observer_t
{
public ecs_header_t hdr;
/// <summary> Query for observer. </summary>
public ecs_filter_t filter;
public fixed ecs_entity_t events[8];
public int event_count;
/// <summary> See ecs_observer_desc_t::callback. </summary>
public ecs_iter_action_t callback;
/// <summary> See ecs_observer_desc_t::run. </summary>
public ecs_run_action_t run;
/// <summary> Callback context. </summary>
public void* ctx;
/// <summary> Binding context (for language bindings). </summary>
public void* binding_ctx;
/// <summary> Callback to free ctx. </summary>
public ecs_ctx_free_t ctx_free;
/// <summary> Callback to free binding_ctx. </summary>
public ecs_ctx_free_t binding_ctx_free;
/// <summary> Observable for observer. </summary>
public ecs_observable_t* observable;
/// <summary> Last handled event id. </summary>
public int* last_event_id;
/// <summary> Id observer is registered with (single term observers only). </summary>
public ecs_id_t register_id;
/// <summary> Index of the term in parent observer (single term observers only). </summary>
public int term_index;
/// <summary> If true, the observer only triggers when the * &lt; filter did not match with the entity before * &lt; the event happened. </summary>
public bool is_monitor;
/// <summary> If true, the observer triggers on more than one term. </summary>
public bool is_multi;
public ecs_poly_dtor_t dtor;
}
/// <summary> Type that contains component lifecycle callbacks. </summary>
//// CXComment_VerbatimLine
public struct ecs_type_hooks_t
{
/// <summary> ctor. </summary>
public ecs_xtor_t ctor;
/// <summary> dtor. </summary>
public ecs_xtor_t dtor;
/// <summary> copy assignment. </summary>
public ecs_copy_t copy;
/// <summary> move assignment. </summary>
public ecs_move_t move;
/// <summary> Ctor + copy. </summary>
public ecs_copy_t copy_ctor;
/// <summary> Ctor + move. </summary>
public ecs_move_t move_ctor;
/// <summary> Ctor + move + dtor (or move_ctor + dtor). This combination is typically used when a component is moved from one location to a new location, like when it is moved to a new table. If not set explicitly it will be derived from other callbacks. </summary>
public ecs_move_t ctor_move_dtor;
/// <summary> Move + dtor. This combination is typically used when a component is moved from one location to an existing location, like what happens during a remove. If not set explicitly it will be derived from other callbacks. </summary>
public ecs_move_t move_dtor;
/// <summary> Callback that is invoked when an instance of a component is added. This callback is invoked before triggers are invoked. </summary>
public ecs_iter_action_t on_add;
/// <summary> Callback that is invoked when an instance of the component is set. This callback is invoked before triggers are invoked, and enable the component to respond to changes on itself before others can. </summary>
public ecs_iter_action_t on_set;
/// <summary> Callback that is invoked when an instance of the component is removed. This callback is invoked after the triggers are invoked, and before the destructor is invoked. </summary>
public ecs_iter_action_t on_remove;
/// <summary> User defined context. </summary>
public void* ctx;
/// <summary> Language binding context. </summary>
public void* binding_ctx;
/// <summary> Callback to free ctx. </summary>
public ecs_ctx_free_t ctx_free;
/// <summary> Callback to free binding_ctx. </summary>
public ecs_ctx_free_t binding_ctx_free;
}
/// <summary> Type that contains component information (passed to ctors/dtors/...). </summary>
//// CXComment_VerbatimLine
public struct ecs_type_info_t
{
/// <summary> Size of type. </summary>
public int size;
/// <summary> Alignment of type. </summary>
public int alignment;
/// <summary> Type hooks. </summary>
public ecs_type_hooks_t hooks;
/// <summary> Handle to component (do not set). </summary>
public ecs_entity_t component;
/// <summary> Type name. </summary>
[Const] public char* name;
}
public struct ecs_stage_t { }
public struct ecs_data_t { }
public struct ecs_switch_t { }
public struct ecs_query_table_node_t { }
/// <summary>
/// <p> Mixin for emitting events to triggers/observers. </p>
/// <p> All observers for a specific event. </p>
/// </summary>
public struct ecs_event_record_t
{
public void* any;
public void* wildcard;
public void* wildcard_pair;
public ecs_map_t event_ids;
public ecs_entity_t @event;
}
public struct ecs_observable_t
{
public ecs_event_record_t on_add;
public ecs_event_record_t on_remove;
public ecs_event_record_t on_set;
public ecs_event_record_t un_set;
public ecs_event_record_t on_wildcard;
public ecs_sparse_t* events;
}
/// <summary> Record for entity index. </summary>
public struct ecs_record_t
{
public ecs_id_record_t* idr;
public ecs_table_t* table;
public uint row;
}
/// <summary> Range in table. </summary>
public struct ecs_table_range_t
{
public ecs_table_t* table;
public int offset;
public int count;
}
/// <summary> Value of query variable. </summary>
public struct ecs_var_t
{
public ecs_table_range_t range;
public ecs_entity_t entity;
}
/// <summary> Cached reference. </summary>
public struct ecs_ref_t
{
public ecs_entity_t entity;
public ecs_entity_t id;
public void* tr;
public ecs_record_t* record;
}
public struct ecs_stack_page_t { }
public struct ecs_stack_cursor_t
{
public void* cur;
public short sp;
}
public struct ecs_page_iter_t
{
public int offset;
public int limit;
public int remaining;
}
public struct ecs_worker_iter_t
{
public int index;
public int count;
}
public struct ecs_table_cache_iter_t
{
public void* cur;
public void* next;
public void* next_list;
}
/// <summary> Term-iterator specific data. </summary>
public struct ecs_term_iter_t
{
public ecs_term_t term;
public ecs_id_record_t* self_index;
public ecs_id_record_t* set_index;
public ecs_id_record_t* cur;
public ecs_table_cache_iter_t it;
public int index;
public int observed_table_count;
public ecs_table_t* table;
public int cur_match;
public int match_count;
public int last_column;
public bool empty_tables;
public ecs_id_t id;
public int column;
public ecs_entity_t subject;
public int size;
public void* ptr;
}
public enum ecs_iter_kind_t
{
EcsIterEvalCondition,
EcsIterEvalTables,
EcsIterEvalChain,
EcsIterEvalNone,
}
/// <summary> Filter-iterator specific data. </summary>
public struct ecs_filter_iter_t
{
[Const] public ecs_filter_t* filter;
public ecs_iter_kind_t kind;
public ecs_term_iter_t term_iter;
public int matches_left;
public int pivot_term;
}
/// <summary> Query-iterator specific data. </summary>
public struct ecs_query_iter_t
{
public ecs_query_t* query;
public ecs_query_table_node_t* node;
public ecs_query_table_node_t* prev;
public ecs_query_table_node_t* last;
public int sparse_smallest;
public int sparse_first;
public int bitset_first;
public int skip_count;
}
/// <summary> Snapshot-iterator specific data. </summary>
public struct ecs_snapshot_iter_t
{
public ecs_filter_t filter;
public ecs_vector_t* tables;
public int index;
}
/// <summary> Rule-iterator specific data. </summary>
public struct ecs_rule_iter_t
{
[Const] public ecs_rule_t* rule;
public void* registers;
public void* op_ctx;
public int* columns;
public ecs_entity_t entity;
public bool redo;
public int op;
public int sp;
}
public struct ecs_iter_cache_t
{
public ecs_stack_cursor_t stack_cursor;
public byte used;
public byte allocated;
}
public struct ecs_iter_private_t
{
public _iter iter;
[StructLayout(LayoutKind.Explicit)]
public struct _iter
{
[FieldOffset(0)]
public ecs_term_iter_t term;
[FieldOffset(0)]
public ecs_filter_iter_t filter;
[FieldOffset(0)]
public ecs_query_iter_t query;
[FieldOffset(0)]
public ecs_rule_iter_t rule;
[FieldOffset(0)]
public ecs_snapshot_iter_t snapshot;
[FieldOffset(0)]
public ecs_page_iter_t page;
[FieldOffset(0)]
public ecs_worker_iter_t worker;
}
public void* entity_iter;
public ecs_iter_cache_t cache;
}
/// <summary> Iterator. </summary>
public struct ecs_iter_t
{
public ecs_world_t* world;
public ecs_world_t* real_world;
public ecs_entity_t* entities;
public void** ptrs;
public int* sizes;
public ecs_table_t* table;
public ecs_table_t* other_table;
public ecs_id_t* ids;
public ecs_var_t* variables;
public int* columns;
public ecs_entity_t* sources;
public int* match_indices;
public ecs_ref_t* references;
public ulong constrained_vars;
public ulong group_id;
public int field_count;
public ecs_entity_t system;
public ecs_entity_t @event;
public ecs_id_t event_id;
public ecs_term_t* terms;
public int table_count;
public int term_index;
public int variable_count;
public char** variable_names;
public void* param;
public void* ctx;
public void* binding_ctx;
public float delta_time;
public float delta_system_time;
public int frame_offset;
public int offset;
public int count;
public int instance_count;
public uint flags;
public ecs_entity_t interrupted_by;
public ecs_iter_private_t priv;
public ecs_iter_next_action_t next;
public ecs_iter_action_t callback;
public ecs_iter_fini_action_t fini;
public ecs_iter_t* chain_it;
}
/// <summary> A component column. </summary>
public struct ecs_vec_t
{
public void* array;
public int count;
public int size;
public int elem_size;
}
public struct ecs_hm_bucket_t
{
public ecs_vec_t keys;
public ecs_vec_t values;
}
public struct ecs_hashmap_t
{
public ecs_hash_value_action_t hash;
public ecs_compare_action_t compare;
public int key_size;
public int value_size;
public ecs_block_allocator_t* hashmap_allocator;
public ecs_map_t impl;
}
public struct flecs_hashmap_iter_t
{
public ecs_map_iter_t it;
public ecs_hm_bucket_t* bucket;
public int index;
}
public struct flecs_hashmap_result_t
{
public void* key;
public void* value;
public ulong hash;
}
/// <summary> Used with ecs_entity_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_entity_desc_t
{
public int _canary;
/// <summary> Set to modify existing entity (optional). </summary>
public ecs_entity_t id;
/// <summary> Name of the entity. If no entity is provided, an entity with this name will be looked up first. When an entity is provided, the name will be verified with the existing entity. </summary>
[Const] public char* name;
/// <summary> Optional custom separator for hierarchical names. Leave to NULL for default ('.') separator. Set to an empty string to prevent tokenization of name. </summary>
[Const] public char* sep;
/// <summary> Optional, used for identifiers relative to root. </summary>
[Const] public char* root_sep;
/// <summary> Optional entity symbol. A symbol is an unscoped identifier that can be used to lookup an entity. The primary use case for this is to associate the entity with a language identifier, such as a type or function name, where these identifiers differ from the name they are registered with in flecs. For example, C type "EcsPosition" might be registered as "flecs.components.transform.Position", with the symbol set to "EcsPosition". </summary>
[Const] public char* symbol;
/// <summary> When set to true, a low id (typically reserved for components) will be used to create the entity, if no id is specified. </summary>
public bool use_low_id;
/// <summary> Array of ids to add to the new or existing entity. </summary>
public fixed ecs_id_t add[32];
/// <summary> String expression with components to add. </summary>
[Const] public char* add_expr;
}
/// <summary> Used with ecs_bulk_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_bulk_desc_t
{
public int _canary;
/// <summary> Entities to bulk insert. Entity ids provided by the application application must be empty (cannot have components). If no entity ids are provided, the operation will create 'count' new entities. </summary>
public ecs_entity_t* entities;
/// <summary> Number of entities to create/populate. </summary>
public int count;
/// <summary> Ids to create the entities with. </summary>
public fixed ecs_id_t ids[32];
/// <summary> Array with component data to insert. Each element in the array must correspond with an element in the ids array. If an element in the ids array is a tag, the data array must contain a NULL. An element may be set to NULL for a component, in which case the component will not be set by the operation. </summary>
public void** data;
/// <summary> Table to insert the entities into. Should not be set at the same time as ids. When 'table' is set at the same time as 'data', the elements in the data array must correspond with the ids in the table's type. </summary>
public ecs_table_t* table;
}
/// <summary> Used with ecs_component_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_component_desc_t
{
public int _canary;
/// <summary> Existing entity to associate with observer (optional). </summary>
public ecs_entity_t entity;
/// <summary> Parameters for type (size, hooks, ...). </summary>
public ecs_type_info_t type;
}
/// <summary> Used with ecs_filter_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_filter_desc_t
{
public int _canary;
/// <summary> Terms of the filter. If a filter has more terms than ECS_TERM_DESC_CACHE_SIZE use terms_buffer. </summary>
public fixed ecs_term_t terms[16];
/// <summary> For filters with lots of terms an outside array can be provided. </summary>
public ecs_term_t* terms_buffer;
/// <summary> Number of terms in array provided in terms_buffer. </summary>
public int terms_buffer_count;
/// <summary> External storage to prevent allocation of the filter object. </summary>
public ecs_filter_t* storage;
/// <summary> When true, terms returned by an iterator may either contain 1 or N elements, where terms with N elements are owned, and terms with 1 element are shared, for example from a parent or base entity. When false, the iterator will at most return 1 element when the result contains both owned and shared terms. </summary>
public bool instanced;
/// <summary> Flags for advanced usage. </summary>
public uint flags;
/// <summary> Filter expression. Should not be set at the same time as terms array. </summary>
[Const] public char* expr;
/// <summary> Entity associated with query (optional). </summary>
public ecs_entity_t entity;
}
/// <summary> Used with ecs_query_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_query_desc_t
{
public int _canary;
/// <summary> Filter for the query. </summary>
public ecs_filter_desc_t filter;
/// <summary> Component to be used by order_by. </summary>
public ecs_entity_t order_by_component;
/// <summary> Callback used for ordering query results. If order_by_id is 0, the pointer provided to the callback will be NULL. If the callback is not set, results will not be ordered. </summary>
public ecs_order_by_action_t order_by;
/// <summary> Callback used for ordering query results. Same as order_by, but more efficient. </summary>
public ecs_sort_table_action_t sort_table;
/// <summary> Id to be used by group_by. This id is passed to the group_by function and can be used identify the part of an entity type that should be used for grouping. </summary>
public ecs_id_t group_by_id;
/// <summary> Callback used for grouping results. If the callback is not set, results will not be grouped. When set, this callback will be used to calculate a "rank" for each entity (table) based on its components. This rank is then used to sort entities (tables), so that entities (tables) of the same rank are "grouped" together when iterated. </summary>
public ecs_group_by_action_t group_by;
/// <summary> Callback that is invoked when a new group is created. The return value of the callback is stored as context for a group. </summary>
public ecs_group_create_action_t on_group_create;
/// <summary> Callback that is invoked when an existing group is deleted. The return value of the on_group_create callback is passed as context parameter. </summary>
public ecs_group_delete_action_t on_group_delete;
/// <summary> Context to pass to group_by. </summary>
public void* group_by_ctx;
/// <summary> Function to free group_by_ctx. </summary>
public ecs_ctx_free_t group_by_ctx_free;
/// <summary> If set, the query will be created as a subquery. A subquery matches at most a subset of its parent query. Subqueries do not directly receive (table) notifications from the world. Instead parent queries forward results to subqueries. This can improve matching performance, as fewer queries need to be matched with new tables. Subqueries can be nested. </summary>
public ecs_query_t* parent;
}
/// <summary> Used with ecs_observer_init. </summary>
//// CXComment_VerbatimLine
public struct ecs_observer_desc_t
{
public int _canary;
/// <summary> Existing entity to associate with observer (optional). </summary>
public ecs_entity_t entity;
/// <summary> Filter for observer. </summary>
public ecs_filter_desc_t filter;
/// <summary> Events to observe (OnAdd, OnRemove, OnSet, UnSet). </summary>
public fixed ecs_entity_t events[8];
/// <summary> When observer is created, generate events from existing data. For example, EcsOnAdd Position would match all existing instances of Position. This is only supported for events that are iterable (see EcsIterable). </summary>
public bool yield_existing;
/// <summary> Callback to invoke on an event, invoked when the observer matches. </summary>
public ecs_iter_action_t callback;
/// <summary> Callback invoked on an event. When left to NULL the default runner is used which matches the event with the observer's filter, and calls 'callback' when it matches. A reason to override the run function is to improve performance, if there are more efficient way to test whether an event matches the observer than the general purpose query matcher. </summary>
public ecs_run_action_t run;
/// <summary> User context to pass to callback. </summary>
public void* ctx;
/// <summary> Context to be used for language bindings. </summary>
public void* binding_ctx;
/// <summary> Callback to free ctx. </summary>
public ecs_ctx_free_t ctx_free;
/// <summary> Callback to free binding_ctx. </summary>
public ecs_ctx_free_t binding_ctx_free;
/// <summary> Observable with which to register the observer. </summary>
public ecs_poly_t* observable;
/// <summary> Optional shared last event id for multiple observers. Ensures only one of the observers with the shared id gets triggered for an event. </summary>
public int* last_event_id;
/// <summary> Used for internal purposes. </summary>
public int term_index;
}
//// CXComment_VerbatimLine
//// CXComment_BlockCommand
public struct ecs_value_t
{
public ecs_entity_t type;
public void* ptr;
}
/// <summary> Type that contains information about the world. </summary>
public struct ecs_world_info_t
{
/// <summary> Last issued component entity id. </summary>
public ecs_entity_t last_component_id;
/// <summary> Last issued entity id. </summary>
public ecs_entity_t last_id;
/// <summary> First allowed entity id. </summary>
public ecs_entity_t min_id;
/// <summary> Last allowed entity id. </summary>
public ecs_entity_t max_id;
/// <summary> Raw delta time (no time scaling). </summary>
public float delta_time_raw;
/// <summary> Time passed to or computed by ecs_progress. </summary>
public float delta_time;
/// <summary> Time scale applied to delta_time. </summary>
public float time_scale;
/// <summary> Target fps. </summary>
public float target_fps;
/// <summary> Total time spent processing a frame. </summary>
public float frame_time_total;
/// <summary> Total time spent in systems. </summary>
public float system_time_total;
/// <summary> Total time spent notifying observers. </summary>
public float emit_time_total;
/// <summary> Total time spent in merges. </summary>
public float merge_time_total;
/// <summary> Time elapsed in simulation. </summary>
public float world_time_total;
/// <summary> Time elapsed in simulation (no scaling). </summary>
public float world_time_total_raw;
/// <summary> Time spent on query rematching. </summary>
public float rematch_time_total;
/// <summary> Total number of frames. </summary>
public long frame_count_total;
/// <summary> Total number of merges. </summary>
public long merge_count_total;
/// <summary> Total number of rematches. </summary>
public long rematch_count_total;
/// <summary> Total number of times a new id was created. </summary>
public long id_create_total;
/// <summary> Total number of times an id was deleted. </summary>
public long id_delete_total;
/// <summary> Total number of times a table was created. </summary>
public long table_create_total;
/// <summary> Total number of times a table was deleted. </summary>
public long table_delete_total;
/// <summary> Total number of pipeline builds. </summary>
public long pipeline_build_count_total;
/// <summary> Total number of systems ran in last frame. </summary>
public long systems_ran_frame;
/// <summary> Total number of times observer was invoked. </summary>
public long observers_ran_frame;
/// <summary> Number of ids in the world (excluding wildcards). </summary>
public int id_count;
/// <summary> Number of tag (no data) ids in the world. </summary>
public int tag_id_count;
/// <summary> Number of component (data) ids in the world. </summary>
public int component_id_count;
/// <summary> Number of pair ids in the world. </summary>
public int pair_id_count;
/// <summary> Number of wildcard ids. </summary>
public int wildcard_id_count;
/// <summary> Number of tables. </summary>
public int table_count;
/// <summary> Number of tag-only tables. </summary>
public int tag_table_count;
/// <summary> Number of tables with trivial components (no lifecycle callbacks). </summary>
public int trivial_table_count;
/// <summary> Number of tables without entities. </summary>
public int empty_table_count;
/// <summary> Total number of table records (entries in table caches). </summary>
public int table_record_count;
/// <summary> Total number of table storages. </summary>
public int table_storage_count;
public _cmd cmd;
public struct _cmd
{
/// <summary> add commands processed. </summary>
public long add_count;
/// <summary> remove commands processed. </summary>
public long remove_count;
/// <summary> delete commands processed. </summary>
public long delete_count;
/// <summary> clear commands processed. </summary>
public long clear_count;
/// <summary> set commands processed. </summary>
public long set_count;
/// <summary> get_mut/emplace commands processed. </summary>
public long get_mut_count;
/// <summary> modified commands processed. </summary>
public long modified_count;
/// <summary> other commands processed. </summary>
public long other_count;
/// <summary> commands discarded, happens when entity is no longer alive when running the command. </summary>
public long discard_count;
/// <summary> entities for which commands were batched. </summary>
public long batched_entity_count;
/// <summary> commands batched. </summary>
public long batched_command_count;
}
/// <summary> Value set by ecs_set_name_prefix. Used to remove library prefixes of symbol names (such as Ecs, ecs_) when registering them as names. </summary>
[Const] public char* name_prefix;
}
/// <summary> Type that contains information about a query group. </summary>
public struct ecs_query_group_info_t
{
/// <summary> How often tables have been matched/unmatched. </summary>
public int match_count;
/// <summary> Number of tables in group. </summary>
public int table_count;
/// <summary> Group context, returned by on_group_create. </summary>
public void* ctx;
}
/// <summary> A (string) identifier. Used as pair with EcsName and EcsSymbol tags. </summary>
public struct EcsIdentifier
{
/// <summary> Identifier string. </summary>
public char* value;
/// <summary> Length of identifier. </summary>
public int length;
/// <summary> Hash of current value. </summary>
public ulong hash;
/// <summary> Hash of existing record in current index. </summary>
public ulong index_hash;
/// <summary> Current index. </summary>
public ecs_hashmap_t* index;
}
/// <summary> Component information. </summary>
public struct EcsComponent
{
/// <summary> Component size. </summary>
public int size;
/// <summary> Component alignment. </summary>
public int alignment;
}
/// <summary> Component for storing a poly object. </summary>
public struct EcsPoly
{
/// <summary> Pointer to poly object. </summary>
public ecs_poly_t* poly;
}
//// CXComment_VerbatimLine
//// CXComment_BlockCommand
public struct ecs_event_desc_t
{
public ecs_entity_t @event;
[Const] public ecs_type_t* ids;
public ecs_table_t* table;
public ecs_table_t* other_table;
public int offset;
public int count;
public ecs_entity_t entity;
[Const] public void* param;
public ecs_poly_t* observable;
public uint flags;
}
/// <summary> Used with ecs_app_run. </summary>
public struct ecs_app_desc_t
{
/// <summary> Target FPS. </summary>
public float target_fps;
/// <summary> Frame time increment (0 for measured values). </summary>
public float delta_time;
/// <summary> Number of threads. </summary>
public int threads;
/// <summary> Number of frames to run (0 for infinite). </summary>
public int frames;
/// <summary> Allows HTTP clients to access ECS data. </summary>
public bool enable_rest;
/// <summary> Periodically collect statistics. </summary>
public bool enable_monitor;
/// <summary> If set, function is ran before starting the main loop. </summary>
public ecs_app_init_action_t init;
/// <summary> Reserved for custom run/frame actions. </summary>
public void* ctx;
}
public struct EcsRest
{
/// <summary> Port of server (optional, default = 27750). </summary>
public ushort port;
/// <summary> Interface address (optional, default = 0.0.0.0). </summary>
public char* ipaddr;
public void* impl;
}
/// <summary> Component used for one shot/interval timer functionality. </summary>
public struct EcsTimer
{
/// <summary> Timer timeout period. </summary>
public float timeout;
/// <summary> Incrementing time value. </summary>
public float time;
/// <summary> Number of times ticked. </summary>
public int fired_count;
/// <summary> Is the timer active or not. </summary>
public bool active;
/// <summary> Is this a single shot timer. </summary>
public bool single_shot;
}
/// <summary> Apply a rate filter to a tick source. </summary>
public struct EcsRateFilter
{
/// <summary> Source of the rate filter. </summary>
public ecs_entity_t src;
/// <summary> Rate of the rate filter. </summary>
public int rate;
/// <summary> Number of times the rate filter ticked. </summary>
public int tick_count;
/// <summary> Time elapsed since last tick. </summary>
public float time_elapsed;
}
public struct ecs_pipeline_desc_t
{
public ecs_entity_t entity;
public ecs_query_desc_t query;
}
/// <summary> Component used to provide a tick source to systems. </summary>
public struct EcsTickSource
{
/// <summary> True if providing tick. </summary>
public bool tick;
/// <summary> Time elapsed since last tick. </summary>
public float time_elapsed;
}
/// <summary> Use with ecs_system_init. </summary>
public struct ecs_system_desc_t
{
public int _canary;
/// <summary> Existing entity to associate with system (optional). </summary>
public ecs_entity_t entity;
/// <summary> System query parameters. </summary>
public ecs_query_desc_t query;
/// <summary>
/// <p> Callback that is invoked when a system is ran. When left to NULL, the default system runner is used, which calls the "callback" action for each result returned from the system's query. </p>
/// <p> It should not be assumed that the input iterator can always be iterated with ecs_query_next. When a system is multithreaded and/or paged, the iterator can be either a worker or paged iterator. Future use cases may introduce additional inputs for a system, such as rules and filters. The correct function to use for iteration is ecs_iter_next. </p>
/// <p> An implementation can test whether the iterator is a query iterator by testing whether the it-&gt;next value is equal to ecs_query_next. </p>
/// </summary>
public ecs_run_action_t run;
/// <summary> Callback that is ran for each result returned by the system's query. This means that this callback can be invoked multiple times per system per frame, typically once for each matching table. </summary>
public ecs_iter_action_t callback;
/// <summary> Context to be passed to callback (as ecs_iter_t::param). </summary>
public void* ctx;
/// <summary> Binding context, for when system is implemented in other language. </summary>
public void* binding_ctx;
/// <summary> Functions that are invoked during system cleanup to free context data. When set, functions are called unconditionally, even when the ctx pointers are NULL. </summary>
public ecs_ctx_free_t ctx_free;
public ecs_ctx_free_t binding_ctx_free;
/// <summary> Interval in seconds at which the system should run. </summary>
public float interval;
/// <summary> Rate at which the system should run. </summary>
public int rate;
/// <summary> External tick soutce that determines when system ticks. </summary>
public ecs_entity_t tick_source;
/// <summary> If true, system will be ran on multiple threads. </summary>
public bool multi_threaded;
/// <summary> If true, system will have access to actuall world. Cannot be true at the same time as multi_threaded. </summary>
public bool no_readonly;
}
/// <summary> Simple value that indicates current state. </summary>
public struct ecs_gauge_t
{
public fixed float avg[60];
public fixed float min[60];
public fixed float max[60];
}
public struct ecs_counter_t
{
/// <summary> Keep track of deltas too. </summary>
public ecs_gauge_t rate;
public fixed double value[60];
}
public struct ecs_world_stats_t
{
public long first_;
public _entities entities;
public struct _entities
{
/// <summary> Number of entities. </summary>
public ecs_metric_t count;
/// <summary> Number of not alive (recyclable) entity ids. </summary>
public ecs_metric_t not_alive_count;
}
public _ids ids;
public struct _ids
{
/// <summary> Number of ids (excluding wildcards). </summary>
public ecs_metric_t count;
/// <summary> Number of tag ids (ids without data). </summary>
public ecs_metric_t tag_count;
/// <summary> Number of components ids (ids with data). </summary>
public ecs_metric_t component_count;
/// <summary> Number of pair ids. </summary>
public ecs_metric_t pair_count;
/// <summary> Number of wildcard ids. </summary>
public ecs_metric_t wildcard_count;
/// <summary> Number of registered types. </summary>
public ecs_metric_t type_count;
/// <summary> Number of times id has been created. </summary>
public ecs_metric_t create_count;
/// <summary> Number of times id has been deleted. </summary>
public ecs_metric_t delete_count;
}
public _tables tables;
public struct _tables
{
/// <summary> Number of tables. </summary>
public ecs_metric_t count;
/// <summary> Number of empty tables. </summary>
public ecs_metric_t empty_count;
/// <summary> Number of tables with only tags. </summary>
public ecs_metric_t tag_only_count;
/// <summary> Number of tables with only trivial components. </summary>
public ecs_metric_t trivial_only_count;
/// <summary> Number of table cache records. </summary>
public ecs_metric_t record_count;
/// <summary> Number of table storages. </summary>
public ecs_metric_t storage_count;
/// <summary> Number of times table has been created. </summary>
public ecs_metric_t create_count;
/// <summary> Number of times table has been deleted. </summary>
public ecs_metric_t delete_count;
}
public _queries queries;
public struct _queries
{
/// <summary> Number of queries. </summary>
public ecs_metric_t query_count;
/// <summary> Number of observers. </summary>
public ecs_metric_t observer_count;
/// <summary> Number of systems. </summary>
public ecs_metric_t system_count;
}
public _commands commands;
public struct _commands
{
public ecs_metric_t add_count;
public ecs_metric_t remove_count;
public ecs_metric_t delete_count;
public ecs_metric_t clear_count;
public ecs_metric_t set_count;
public ecs_metric_t get_mut_count;
public ecs_metric_t modified_count;
public ecs_metric_t other_count;
public ecs_metric_t discard_count;
public ecs_metric_t batched_entity_count;
public ecs_metric_t batched_count;
}
public _frame frame;
public struct _frame
{
/// <summary> Number of frames processed. </summary>
public ecs_metric_t frame_count;
/// <summary> Number of merges executed. </summary>
public ecs_metric_t merge_count;
/// <summary> Number of query rematches. </summary>
public ecs_metric_t rematch_count;
/// <summary> Number of system pipeline rebuilds (occurs when an inactive system becomes active). </summary>
public ecs_metric_t pipeline_build_count;
/// <summary> Number of systems ran. </summary>
public ecs_metric_t systems_ran;
/// <summary> Number of times an observer was invoked. </summary>
public ecs_metric_t observers_ran;
/// <summary> Number of events emitted. </summary>
public ecs_metric_t event_emit_count;
}
public _performance performance;
public struct _performance
{
/// <summary> Actual time passed since simulation start (first time progress() is called). </summary>
public ecs_metric_t world_time_raw;
/// <summary> Simulation time passed since simulation start. Takes into account time scaling. </summary>
public ecs_metric_t world_time;
/// <summary> Time spent processing a frame. Smaller than world_time_total when load is not 100%. </summary>
public ecs_metric_t frame_time;
/// <summary> Time spent on running systems. </summary>
public ecs_metric_t system_time;
/// <summary> Time spent on notifying observers. </summary>
public ecs_metric_t emit_time;
/// <summary> Time spent on merging commands. </summary>
public ecs_metric_t merge_time;
/// <summary> Time spent on rematching. </summary>
public ecs_metric_t rematch_time;
/// <summary> Frames per second. </summary>
public ecs_metric_t fps;
/// <summary> Delta_time. </summary>
public ecs_metric_t delta_time;
}
public _memory memory;
public struct _memory
{
/// <summary> Allocs per frame. </summary>
public ecs_metric_t alloc_count;
/// <summary> Reallocs per frame. </summary>
public ecs_metric_t realloc_count;
/// <summary> Frees per frame. </summary>
public ecs_metric_t free_count;
/// <summary> Difference between allocs & frees. </summary>
public ecs_metric_t outstanding_alloc_count;
/// <summary> Block allocations per frame. </summary>
public ecs_metric_t block_alloc_count;
/// <summary> Block frees per frame. </summary>
public ecs_metric_t block_free_count;
/// <summary> Difference between allocs & frees. </summary>
public ecs_metric_t block_outstanding_alloc_count;
/// <summary> Page allocations per frame. </summary>
public ecs_metric_t stack_alloc_count;
/// <summary> Page frees per frame. </summary>
public ecs_metric_t stack_free_count;
/// <summary> Difference between allocs & frees. </summary>
public ecs_metric_t stack_outstanding_alloc_count;
}
public _rest rest;
public struct _rest
{
public ecs_metric_t request_count;
public ecs_metric_t entity_count;
public ecs_metric_t entity_error_count;
public ecs_metric_t query_count;
public ecs_metric_t query_error_count;
public ecs_metric_t query_name_count;
public ecs_metric_t query_name_error_count;
public ecs_metric_t query_name_from_cache_count;
public ecs_metric_t enable_count;
public ecs_metric_t enable_error_count;
public ecs_metric_t world_stats_count;
public ecs_metric_t pipeline_stats_count;
public ecs_metric_t stats_error_count;
}
public _http http;
public struct _http
{
public ecs_metric_t request_received_count;
public ecs_metric_t request_invalid_count;
public ecs_metric_t request_handled_ok_count;
public ecs_metric_t request_handled_error_count;
public ecs_metric_t request_not_handled_count;
public ecs_metric_t request_preflight_count;
public ecs_metric_t send_ok_count;
public ecs_metric_t send_error_count;
public ecs_metric_t busy_count;
}
public long last_;
/// <summary> Current position in ringbuffer. </summary>
public int t;
}
public struct ecs_query_stats_t
{
public long first_;
/// <summary> Matched non-empty tables. </summary>
public ecs_metric_t matched_table_count;
/// <summary> Matched empty tables. </summary>
public ecs_metric_t matched_empty_table_count;
/// <summary> Number of matched entities. </summary>
public ecs_metric_t matched_entity_count;
public long last_;
/// <summary> Current position in ringbuffer. </summary>
public int t;
}
/// <summary> Statistics for a single system (use ecs_system_stats_get). </summary>
public struct ecs_system_stats_t
{
public long first_;
/// <summary> Time spent processing a system. </summary>
public ecs_metric_t time_spent;
/// <summary> Number of times system is invoked. </summary>
public ecs_metric_t invoke_count;
/// <summary> Whether system is active (is matched with &gt;0 entities). </summary>
public ecs_metric_t active;
/// <summary> Whether system is enabled. </summary>
public ecs_metric_t enabled;
public long last_;
/// <summary> Is system a task. </summary>
public bool task;
public ecs_query_stats_t query;
}
/// <summary> Statistics for all systems in a pipeline. </summary>
public struct ecs_pipeline_stats_t
{
/// <summary> Vector with system ids of all systems in the pipeline. The systems are stored in the order they are executed. Merges are represented by a 0. </summary>
public ecs_vector_t* systems;
/// <summary> Map with system statistics. For each system in the systems vector, an entry in the map exists of type ecs_system_stats_t. </summary>
public ecs_map_t system_stats;
/// <summary> Current position in ringbuffer. </summary>
public int t;
/// <summary> Number of systems in pipeline. </summary>
public int system_count;
/// <summary> Number of active systems in pipeline. </summary>
public int active_system_count;
/// <summary> Number of times pipeline has rebuilt. </summary>
public int rebuild_count;
}
public struct EcsStatsHeader
{
public float elapsed;
public int reduce_count;
}
public struct EcsWorldStats
{
public EcsStatsHeader hdr;
public ecs_world_stats_t stats;
}
public struct EcsPipelineStats
{
public EcsStatsHeader hdr;
public ecs_pipeline_stats_t stats;
}
public struct EcsDocDescription
{
public char* value;
}
/// <summary> Used with ecs_parse_json. </summary>
public struct ecs_parse_json_desc_t
{
[Const] public char* name;
[Const] public char* expr;
}
/// <summary> Used with ecs_iter_to_json. </summary>
public struct ecs_entity_to_json_desc_t
{
public bool serialize_path;
public bool serialize_meta_ids;
public bool serialize_label;
public bool serialize_brief;
public bool serialize_link;
public bool serialize_color;
public bool serialize_id_labels;
public bool serialize_base;
public bool serialize_private;
public bool serialize_hidden;
public bool serialize_values;
public bool serialize_type_info;
}
/// <summary> Used with ecs_iter_to_json. </summary>
public struct ecs_iter_to_json_desc_t
{
public bool serialize_term_ids;
public bool serialize_ids;
public bool serialize_sources;
public bool serialize_variables;
public bool serialize_is_set;
public bool serialize_values;
public bool serialize_entities;
public bool serialize_entity_labels;
public bool serialize_entity_ids;
public bool serialize_variable_labels;
public bool serialize_variable_ids;
public bool serialize_colors;
public bool measure_eval_duration;
public bool serialize_type_info;
}
/// <summary> Type kinds supported by reflection type system. </summary>
public enum ecs_type_kind_t
{
EcsPrimitiveType,
EcsBitmaskType,
EcsEnumType,
EcsStructType,
EcsArrayType,
EcsVectorType,
EcsTypeKindLast,
}
/// <summary> Component that is automatically added to every type with the right kind. </summary>
public struct EcsMetaType
{
public ecs_type_kind_t kind;
public bool existing;
public bool partial;
public int size;
public int alignment;
}
public enum ecs_primitive_kind_t
{
EcsBool,
EcsChar,
EcsByte,
EcsU8,
EcsU16,
EcsU32,
EcsU64,
EcsI8,
EcsI16,
EcsI32,
EcsI64,
EcsF32,
EcsF64,
EcsUPtr,
EcsIPtr,
EcsString,
EcsEntity,
EcsPrimitiveKindLast,
}
public struct EcsPrimitive
{
public ecs_primitive_kind_t kind;
}
public struct EcsMember
{
public ecs_entity_t type;
public int count;
public ecs_entity_t unit;
public int offset;
}
public struct ecs_member_t
{
[Const] public char* name;
public ecs_entity_t type;
public int count;
public int offset;
public ecs_entity_t unit;
public int size;
public ecs_entity_t member;
}
public struct EcsStruct
{
public ecs_vector_t* members;
}
public struct ecs_enum_constant_t
{
[Const] public char* name;
public int value;
public ecs_entity_t constant;
}
public struct EcsEnum
{
public ecs_map_t* constants;
}
public struct ecs_bitmask_constant_t
{
[Const] public char* name;
public uint value;
public ecs_entity_t constant;
}
public struct EcsBitmask
{
public ecs_map_t* constants;
}
public struct EcsArray
{
public ecs_entity_t type;
public int count;
}
public struct EcsVector
{
public ecs_entity_t type;
}
public struct ecs_unit_translation_t
{
public int factor;
public int power;
}
public struct EcsUnit
{
public char* symbol;
public ecs_entity_t prefix;
public ecs_entity_t @base;
public ecs_entity_t over;
public ecs_unit_translation_t translation;
}
public struct EcsUnitPrefix
{
public char* symbol;
public ecs_unit_translation_t translation;
}
/// <summary> Serializer utilities. </summary>
public enum ecs_meta_type_op_kind_t
{
EcsOpArray,
EcsOpVector,
EcsOpPush,
EcsOpPop,
EcsOpScope,
EcsOpEnum,
EcsOpBitmask,
EcsOpPrimitive,
EcsOpBool,
EcsOpChar,
EcsOpByte,
EcsOpU8,
EcsOpU16,
EcsOpU32,
EcsOpU64,
EcsOpI8,
EcsOpI16,
EcsOpI32,
EcsOpI64,
EcsOpF32,
EcsOpF64,
EcsOpUPtr,
EcsOpIPtr,
EcsOpString,
EcsOpEntity,
EcsMetaTypeOpKindLast,
}
public struct ecs_meta_type_op_t
{
public ecs_meta_type_op_kind_t kind;
public int offset;
public int count;
[Const] public char* name;
public int op_count;
public int size;
public ecs_entity_t type;
public ecs_entity_t unit;
public ecs_hashmap_t* members;
}
public struct EcsMetaTypeSerialized
{
public ecs_vector_t* ops;
}
public struct ecs_meta_scope_t
{
public ecs_entity_t type;
public ecs_meta_type_op_t* ops;
public int op_count;
public int op_cur;
public int elem_cur;
public int prev_depth;
public void* ptr;
[Const] public EcsComponent* comp;
public ecs_vector_t** vector;
public bool is_collection;
public bool is_inline_array;
}
/// <summary> Type that enables iterating/populating a value using reflection data. </summary>
public struct ecs_meta_cursor_t
{
[Const] public ecs_world_t* world;
public fixed ecs_meta_scope_t scope[32];
public int depth;
public bool valid;
public bool is_primitive_scope;
public delegate* unmanaged<ecs_world_t*, char*, void*, ecs_entity_t> lookup_action;
public void* lookup_ctx;
}
/// <summary> Used with ecs_primitive_init. </summary>
public struct ecs_primitive_desc_t
{
public ecs_entity_t entity;
public ecs_primitive_kind_t kind;
}
/// <summary> Used with ecs_enum_init. </summary>
public struct ecs_enum_desc_t
{
public ecs_entity_t entity;
public fixed ecs_enum_constant_t constants[32];
}
/// <summary> Used with ecs_bitmask_init. </summary>
public struct ecs_bitmask_desc_t
{
public ecs_entity_t entity;
public fixed ecs_bitmask_constant_t constants[32];
}
/// <summary> Used with ecs_array_init. </summary>
public struct ecs_array_desc_t
{
public ecs_entity_t entity;
public ecs_entity_t type;
public int count;
}
/// <summary> Used with ecs_vector_init. </summary>
public struct ecs_vector_desc_t
{
public ecs_entity_t entity;
public ecs_entity_t type;
}
/// <summary> Used with ecs_struct_init. </summary>
public struct ecs_struct_desc_t
{
public ecs_entity_t entity;
public fixed ecs_member_t members[32];
}
/// <summary> Used with ecs_unit_init. </summary>
public struct ecs_unit_desc_t
{
public ecs_entity_t entity;
[Const] public char* symbol;
public ecs_entity_t quantity;
public ecs_entity_t @base;
public ecs_entity_t over;
public ecs_unit_translation_t translation;
public ecs_entity_t prefix;
}
/// <summary> Used with ecs_unit_prefix_init. </summary>
public struct ecs_unit_prefix_desc_t
{
public ecs_entity_t entity;
[Const] public char* symbol;
public ecs_unit_translation_t translation;
}
/// <summary> Storage for parser variables. Variables make it possible to parameterize expression strings, and are referenced with the $ operator (e.g. $var). </summary>
public struct ecs_expr_var_t
{
public char* name;
public ecs_value_t value;
}
public struct ecs_expr_var_scope_t
{
public ecs_hashmap_t var_index;
public ecs_vec_t vars;
public void* parent;
}
public struct ecs_vars_t
{
public ecs_world_t* world;
public ecs_expr_var_scope_t root;
public ecs_expr_var_scope_t* cur;
}
/// <summary> Used with ecs_parse_expr. </summary>
public struct ecs_parse_expr_desc_t
{
[Const] public char* name;
[Const] public char* expr;
public delegate* unmanaged<ecs_world_t*, char*, void*, ecs_entity_t> lookup_action;
public void* lookup_ctx;
public ecs_vars_t* vars;
}
public struct ecs_snapshot_t { }
public struct ecs_http_server_t { }
/// <summary> A connection manages communication with the remote host. </summary>
public struct ecs_http_connection_t
{
public ulong id;
public ecs_http_server_t* server;
public fixed char host[128];
public fixed char port[16];
}
/// <summary> Helper type used for headers & URL query parameters. </summary>
public struct ecs_http_key_value_t
{
[Const] public char* key;
[Const] public char* value;
}
/// <summary> Supported request methods. </summary>
public ecs_http_method_t
{
EcsHttpGet,
EcsHttpPost,
EcsHttpPut,
EcsHttpDelete,
EcsHttpOptions,
EcsHttpMethodUnsupported,
}
/// <summary> A request. </summary>
public struct ecs_http_request_t
{
public ulong id;
public ecs_http_method_t method;
public char* path;
public char* body;
public fixed ecs_http_key_value_t headers[32];
public fixed ecs_http_key_value_t @params[32];
public int header_count;
public int param_count;
public ecs_http_connection_t* conn;
}
/// <summary> A reply. </summary>
public struct ecs_http_reply_t
{
/// <summary> default = 200. </summary>
public int code;
/// <summary> default = "". </summary>
public ecs_strbuf_t body;
/// <summary> default = OK. </summary>
[Const] public char* status;
/// <summary> default = application/json. </summary>
[Const] public char* content_type;
/// <summary> default = "". </summary>
public ecs_strbuf_t headers;
}
/// <summary> Used with ecs_http_server_init. </summary>
public struct ecs_http_server_desc_t
{
public ecs_http_reply_action_t callback;
public void* ctx;
public ushort port;
[Const] public char* ipaddr;
public int send_queue_wait_ms;
}
}