This repository has been archived on 2024-02-21. You can view files and clone it, but cannot push or open issues or pull requests.
MainTree/core/inc-c/state.h

33 lines
835 B
C

#ifndef MT_STATE_H
#define MT_STATE_H
#include <tag_registry.h>
#include <entity.h>
#include <librr/types.h>
#include <librr/alloc/generic.h>
typedef struct MtState MtState;
typedef bool_t (*MtQueryMatcherFn) (MtEntity *entity, void *userdata);
struct MtState
{
char *app_name;
MtTagRegistry tag_registry;
MtEntityRegistry entity_registry;
};
MtState * mt_initialize(char *app_name);
void mt_cleanup(MtState *state);
void mt_start(MtState *state);
MtEntity * mt_summon(MtState *state);
void mt_drop(MtEntity *entity);
usz_t mt_query(MtState *state, const char **tags, MtEntity **entities, usz_t count);
usz_t mt_match_query(MtState *state, const char **tags, MtEntity **entities, usz_t count, MtQueryMatcherFn matcher, void *userdata);
#endif // MT_STATE_H