feat(entities): removed spawn function from behaviour entities
This commit is contained in:
parent
1ee59154fc
commit
54efa7c83e
|
@ -6,7 +6,6 @@
|
||||||
#include "vmath.h"
|
#include "vmath.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
void (*const spawn)(void* self, Vector at);
|
|
||||||
void (*const update)(void* self, float dt);
|
void (*const update)(void* self, float dt);
|
||||||
void (*const start)(void* self);
|
void (*const start)(void* self);
|
||||||
void (*const draw)(void* self);
|
void (*const draw)(void* self);
|
||||||
|
@ -18,13 +17,12 @@ typedef struct {
|
||||||
IDrop const* drop;
|
IDrop const* drop;
|
||||||
} BehaviourEntity;
|
} BehaviourEntity;
|
||||||
|
|
||||||
#define impl_BehaviourEntity_for(T, start_f, update_f, spawn_f, draw_f)\
|
#define impl_BehaviourEntity_for(T, start_f, update_f, draw_f)\
|
||||||
static inline BehaviourEntity T##_as_BehaviourEntity(T* x) {\
|
static inline BehaviourEntity T##_as_BehaviourEntity(T* x) {\
|
||||||
TC_FN_TYPECHECK(void, start_f, T*);\
|
TC_FN_TYPECHECK(void, start_f, T*);\
|
||||||
TC_FN_TYPECHECK(void, update_f, T*, float);\
|
TC_FN_TYPECHECK(void, update_f, T*, float);\
|
||||||
TC_FN_TYPECHECK(void, draw_f, T*);\
|
TC_FN_TYPECHECK(void, draw_f, T*);\
|
||||||
static IEntityBehaviour const tc = {\
|
static IEntityBehaviour const tc = {\
|
||||||
.spawn = (void(*const)(void*, Vector)) spawn_f,\
|
|
||||||
.update = (void(*const)(void*, float)) update_f,\
|
.update = (void(*const)(void*, float)) update_f,\
|
||||||
.start = (void(*const)(void*)) start_f,\
|
.start = (void(*const)(void*)) start_f,\
|
||||||
.draw = (void(*const)(void*)) draw_f,\
|
.draw = (void(*const)(void*)) draw_f,\
|
||||||
|
|
Loading…
Reference in a new issue