2024-01-29 18:48:56 +00:00
|
|
|
|
|
|
|
#ifndef MT_STATE_H
|
|
|
|
#define MT_STATE_H
|
|
|
|
|
|
|
|
#include <tag_registry.h>
|
|
|
|
#include <entity.h>
|
|
|
|
|
|
|
|
#include <librr/types.h>
|
|
|
|
#include <librr/alloc/generic.h>
|
|
|
|
|
2024-01-30 21:47:43 +00:00
|
|
|
typedef struct MtState MtState;
|
2024-02-01 00:55:13 +00:00
|
|
|
typedef bool_t (*MtQueryMatcherFn) (MtEntity *entity, void *userdata);
|
2024-01-29 18:48:56 +00:00
|
|
|
|
|
|
|
struct MtState
|
|
|
|
{
|
|
|
|
char *app_name;
|
|
|
|
|
|
|
|
MtTagRegistry tag_registry;
|
2024-01-30 21:31:31 +00:00
|
|
|
MtEntityRegistry entity_registry;
|
2024-01-29 18:48:56 +00:00
|
|
|
};
|
|
|
|
|
2024-01-30 21:47:43 +00:00
|
|
|
MtState * mt_initialize(char *app_name);
|
|
|
|
void mt_cleanup(MtState *state);
|
|
|
|
void mt_start(MtState *state);
|
2024-01-29 18:48:56 +00:00
|
|
|
|
2024-01-30 21:47:43 +00:00
|
|
|
MtEntity * mt_summon(MtState *state);
|
2024-01-30 22:59:59 +00:00
|
|
|
void mt_drop(MtEntity *entity);
|
2024-01-29 18:48:56 +00:00
|
|
|
|
2024-02-01 00:55:13 +00:00
|
|
|
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);
|
|
|
|
|
2024-01-29 18:48:56 +00:00
|
|
|
#endif // MT_STATE_H
|