7#include "nlua_asteroid.h"
8#include "nlua_faction.h"
10#include "nlua_pilot.h"
13#define HOOK_MAX_PARAM 5
18typedef enum HookParamType_e {
38typedef struct HookParam_s {
63unsigned int hook_addMisn(
unsigned int parent,
const char *func,
const char *stack );
64unsigned int hook_addEvent(
unsigned int parent,
const char *func,
const char *stack );
65unsigned int hook_addFunc(
int (*func)(
void*),
void *data,
const char *stack );
73int pilot_runHookParam(
Pilot* p,
int hook_type,
const HookParam *param,
int nparam );
74nlua_env
hook_env(
unsigned int hook );
115unsigned int hook_addTimerMisn(
unsigned int parent,
const char *func,
double ms );
116unsigned int hook_addTimerEvt(
unsigned int parent,
const char *func,
double ms );
120unsigned int hook_addDateMisn(
unsigned int parent,
const char *func, ntime_t resolution );
121unsigned int hook_addDateEvt(
unsigned int parent,
const char *func, ntime_t resolution );
unsigned int hook_addTimerEvt(unsigned int parent, const char *func, double ms)
Adds a new event type hook timer.
int hook_runIDparam(unsigned int id, const HookParam *param)
Runs a single hook by id.
int hooks_runParam(const char *stack, const HookParam *param)
Runs all the hooks of stack.
void hook_rmMisnParent(unsigned int parent)
Removes all hooks belonging to parent mission.
void hooks_update(double dt)
Updates all the hook timer related stuff.
int hook_runID(unsigned int id)
Runs a single hook by id.
int hook_hasEventParent(unsigned int parent)
Checks to see how many hooks there are with the same event parent.
void hook_clear(void)
Clears the hooks.
void hook_cleanup(void)
Gets rid of all current hooks.
int hooks_runParamDeferred(const char *stack, const HookParam *param)
Runs all the hooks of stack in the next frame. Does not trigger right away.
nlua_env hook_env(unsigned int hook)
Gets the lua env for a hook.
void hooks_updateDate(ntime_t change)
Updates the time to see if it should be updated.
unsigned int hook_addEvent(unsigned int parent, const char *func, const char *stack)
Adds a new event type hook.
void hook_rm(unsigned int id)
Removes a hook.
void hook_exclusionEnd(double dt)
Ends exclusion zone and runs all the queued hooks.
int hooks_run(const char *stack)
Runs all the hooks of stack.
void hook_rmEventParent(unsigned int parent)
Removes all hooks belonging to parent event.
unsigned int hook_addFunc(int(*func)(void *), void *data, const char *stack)
Adds a function hook to be run.
int hook_hasMisnParent(unsigned int parent)
Checks to see how many hooks there are with the same mission parent.
void hook_exclusionStart(void)
Starts the hook exclusion zone, this makes hooks queue until exclusion is done.
unsigned int hook_addTimerMisn(unsigned int parent, const char *func, double ms)
Adds a new mission type hook timer hook.
unsigned int hook_addMisn(unsigned int parent, const char *func, const char *stack)
Adds a new mission type hook.
The actual hook parameter.
A ship outfit, depends radically on the type.
The representation of an in-game pilot.