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

31 lines
665 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"
2021-01-18 12:16:38 +00:00
ECS_STRUCT(Vector2D, {
2021-01-17 15:33:56 +00:00
int16_t x;
int16_t y;
});
2021-01-18 13:45:16 +00:00
ECS_STRUCT(Drawable, {
2021-01-18 14:46:11 +00:00
uint16_t id;
2021-01-18 13:45:16 +00:00
});
2021-01-18 16:54:25 +00:00
ECS_ALIAS(Vector2D, Chunk);
ECS_ALIAS(Vector2D, Position);
2021-01-17 15:33:56 +00:00
typedef struct {
ECS_DECLARE_COMPONENT(Chunk);
ECS_DECLARE_COMPONENT(Position);
2021-01-18 12:16:38 +00:00
ECS_DECLARE_COMPONENT(Vector2D);
2021-01-18 13:45:16 +00:00
ECS_DECLARE_COMPONENT(Drawable);
2021-01-18 12:16:38 +00:00
} General;
2021-01-17 15:33:56 +00:00
2021-01-18 12:16:38 +00:00
#define GeneralImportHandles(handles)\
2021-01-17 15:33:56 +00:00
ECS_IMPORT_COMPONENT(handles, Chunk);\
2021-01-18 12:16:38 +00:00
ECS_IMPORT_COMPONENT(handles, Vector2D);\
2021-01-18 13:45:16 +00:00
ECS_IMPORT_COMPONENT(handles, Position);\
ECS_IMPORT_COMPONENT(handles, Drawable);\
2021-01-17 15:33:56 +00:00
2021-01-19 10:19:12 +00:00
void GeneralImport(ecs_world_t *ecs);