Changed the API to be more generic and to have fewer different functions.
This commit is contained in:
parent
c69f260790
commit
3a38d8341b
|
@ -15,10 +15,8 @@ typedef void * MtState;
|
|||
|
||||
|
||||
|
||||
typedef void (*mt_type_effector_fn) (MtType type);
|
||||
typedef void (*mt_entity_effector_fn) (MtEntity entity);
|
||||
typedef void (*mt_task_type_effector_fn) (MtTask task, MtType type, void *userdata);
|
||||
typedef void (*mt_task_entity_effector_fn) (MtTask task, MtEntity entity, void *userdata);
|
||||
typedef void (*mt_type_effector_fn) (MtType type, void *userdata, usz_t invocation);
|
||||
typedef void (*mt_entity_effector_fn) (MtEntity entity, void *userdata, usz_t invocation);
|
||||
typedef void (*mt_task_main_fn) (MtTask task, void *userdata);
|
||||
|
||||
typedef struct
|
||||
|
@ -40,11 +38,11 @@ MtType mt_register_type(char *identifier);
|
|||
void mt_forget_type(MtType type);
|
||||
|
||||
MtEntity mt_make(MtType type);
|
||||
void mt_add_registration_effector(MtState state, char *effector_name, mt_type_effector_fn function);
|
||||
void mt_add_create_effector(MtType type, char *effector_name, mt_entity_effector_fn function);
|
||||
void mt_add_delete_effector(MtType type, char *effector_name, mt_entity_effector_fn function);
|
||||
void mt_add_item_tick_effector(MtType type, char *effector_name, usz_t ticks_delta, mt_entity_effector_fn function);
|
||||
void mt_add_tick_effector(MtState state, char *effector_name, usz_t ticks_delta, mt_entity_effector_fn function);
|
||||
void mt_add_registration_effector(MtState state, char *effector_name, mt_type_effector_fn function, void *userdata);
|
||||
void mt_add_create_effector(MtType type, char *effector_name, mt_entity_effector_fn function, void *userdata);
|
||||
void mt_add_delete_effector(MtType type, char *effector_name, mt_entity_effector_fn function, void *userdata);
|
||||
void mt_add_entity_tick_effector(MtType type, char *effector_name, usz_t ticks_delta, mt_entity_effector_fn function, void *userdata);
|
||||
void mt_add_tick_effector(MtState state, char *effector_name, usz_t ticks_delta, mt_entity_effector_fn function, void *userdata);
|
||||
void mt_task_remove_effector(MtState task, const char *effector_name);
|
||||
|
||||
/// @brief Adds a tick effector which only acts upon entitys with certain tags.
|
||||
|
@ -76,13 +74,6 @@ rr_vec4f_s mt_untag_vec4(MtEntity entity, char *name);
|
|||
MtTask mt_create_task(MtState state, MtTaskCreationInfo creation_info);
|
||||
void mt_delete_task(MtTask task);
|
||||
|
||||
void mt_task_add_registration_effector(MtTask task, char *effector_name, mt_task_type_effector_fn function);
|
||||
void mt_task_add_create_effector(MtTask task, MtType type, char *effector_name, mt_task_entity_effector_fn function);
|
||||
void mt_task_add_delete_effector(MtTask task, MtType type, char *effector_name, mt_task_entity_effector_fn function);
|
||||
void mt_task_add_tick_effector(MtTask task, MtType type, char *effector_name, usz_t ticks_delta, mt_task_entity_effector_fn function);
|
||||
void mt_task_add_entity_tick_effector(MtTask task, MtType type, char *effector_name, usz_t ticks_delta, mt_task_entity_effector_fn function);
|
||||
void mt_task_add_tagged_tick_effector(MtTask task, MtType type, char *effector_name, usz_t ticks_delta, mt_task_entity_effector_fn function, char **tag_names);
|
||||
void mt_task_add_main_function(MtTask task, mt_task_main_fn function);
|
||||
void mt_task_remove_effector(MtTask task, const char *effector_name);
|
||||
|
||||
#endif // MAINTREE_H
|
||||
|
|
Reference in New Issue