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

29 lines
712 B
C
Raw Normal View History

2021-01-18 12:16:38 +00:00
#pragma once
#include "flecs/flecs.h"
#include "flecs/flecs_meta.h"
ECS_STRUCT(Input, {
double x;
double y;
uint8_t use;
});
typedef struct {
ECS_DECLARE_COMPONENT(Input);
2021-01-18 13:45:16 +00:00
ECS_DECLARE_ENTITY(EcsActor);
2021-01-18 12:16:38 +00:00
ECS_DECLARE_ENTITY(EcsPlayer);
ECS_DECLARE_ENTITY(EcsBuilder);
ECS_DECLARE_TYPE(Player);
ECS_DECLARE_TYPE(Builder);
} Controllers;
#define ControllersImportHandles(handles)\
ECS_IMPORT_COMPONENT(handles, Input);\
ECS_IMPORT_TYPE(handles, Player);\
ECS_IMPORT_TYPE(handles, Builder);\
2021-01-18 13:45:16 +00:00
ECS_IMPORT_ENTITY(handles, EcsActor);\
2021-01-18 12:16:38 +00:00
ECS_IMPORT_ENTITY(handles, EcsPlayer);\
ECS_IMPORT_ENTITY(handles, EcsBuilder);\
2021-01-19 10:19:12 +00:00
void ControllersImport(ecs_world_t *ecs);