MainTree/inc-c/entity.h

41 lines
1.4 KiB
C
Raw Normal View History

2024-02-20 06:35:53 +00:00
#ifndef MT_ENTITY_H
#define MT_ENTITY_H
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include <alphaumlaut/maths.h>
2024-02-20 06:35:53 +00:00
typedef struct MtEntity MtEntity;
/// @brief: An MtEntity is a frontend descriptor which stands in
/// the place of internal data without the need to reference
/// actual internal data.
struct MtEntity
{
/// @brief: The context which this MtEntity belongs to. This is
/// also the context which is referenced each time a function
/// uses the entity and needs to find its shadow.
void *context;
/// @brief: The identifier of the background structure "shadow".
/// This is used for resolving this entity to its actual data.
uint32_t shadow_id;
2024-02-20 06:35:53 +00:00
};
MtEntity mt_summon(void *context_ptr);
void mt_delete(MtEntity entity);
void mt_tag_bool(MtEntity entity, const char *name, bool boolean);
void mt_tag_int(MtEntity entity, const char *name, int64_t integer);
void mt_tag_float(MtEntity entity, const char *name, double real);
void mt_tag_str(MtEntity entity, const char *name, char *string);
void mt_tag_ptr(MtEntity entity, const char *name, void *pointer);
void mt_tag_vec2f(MtEntity entity, const char *name, AuVec2f vec2f);
void mt_tag_vec3f(MtEntity entity, const char *name, AuVec3f vec3f);
void mt_tag_vec4f(MtEntity entity, const char *name, AuVec4f vec4f);
void mt_tag_ref(MtEntity entity, const char *name, MtEntity reference);
2024-02-20 06:35:53 +00:00
#endif // MT_ENTITY_H