eco2d/code/apps/server/header/components/general.h

37 lines
691 B
C
Raw Normal View History

2021-01-17 15:33:56 +00:00
#pragma once
#include "flecs/flecs.h"
#include "flecs/flecs_meta.h"
ECS_STRUCT(Chunk, {
int16_t x;
int16_t y;
});
ECS_STRUCT(Position, {
int16_t x;
int16_t y;
});
typedef struct {
ECS_DECLARE_COMPONENT(Chunk);
ECS_DECLARE_COMPONENT(Position);
} Common;
#define CommonImportHandles(handles)\
ECS_IMPORT_COMPONENT(handles, Chunk);\
ECS_IMPORT_COMPONENT(handles, Position);
static inline void CommonImport(ecs_world_t *ecs) {
ECS_MODULE(ecs, Common);
ecs_set_name_prefix(ecs, "Common");
ECS_IMPORT(ecs, FlecsMeta);
ECS_META(ecs, Chunk);
ECS_META(ecs, Position);
ECS_EXPORT_COMPONENT(Chunk);
ECS_EXPORT_COMPONENT(Position);
}