nakedmud-mod/
nakedmud-mod/html/tutorials/
nakedmud-mod/html/tutorials/building_extras/
nakedmud-mod/html/tutorials/c/
nakedmud-mod/html/tutorials/reference/
nakedmud-mod/html/tutorials/scripting/
nakedmud-mod/html/tutorials/scripting_extras/
nakedmud-mod/lib/
nakedmud-mod/lib/help/A/
nakedmud-mod/lib/help/B/
nakedmud-mod/lib/help/C/
nakedmud-mod/lib/help/D/
nakedmud-mod/lib/help/G/
nakedmud-mod/lib/help/H/
nakedmud-mod/lib/help/J/
nakedmud-mod/lib/help/L/
nakedmud-mod/lib/help/M/
nakedmud-mod/lib/help/O/
nakedmud-mod/lib/help/P/
nakedmud-mod/lib/help/R/
nakedmud-mod/lib/help/S/
nakedmud-mod/lib/help/W/
nakedmud-mod/lib/logs/
nakedmud-mod/lib/misc/
nakedmud-mod/lib/players/
nakedmud-mod/lib/pymodules/polc/
nakedmud-mod/lib/txt/
nakedmud-mod/lib/world/
nakedmud-mod/lib/world/zones/examples/
nakedmud-mod/lib/world/zones/examples/mproto/
nakedmud-mod/lib/world/zones/examples/oproto/
nakedmud-mod/lib/world/zones/examples/reset/
nakedmud-mod/lib/world/zones/examples/rproto/
nakedmud-mod/lib/world/zones/examples/trigger/
nakedmud-mod/lib/world/zones/limbo/
nakedmud-mod/lib/world/zones/limbo/room/
nakedmud-mod/lib/world/zones/limbo/rproto/
nakedmud-mod/src/alias/
nakedmud-mod/src/dyn_vars/
nakedmud-mod/src/editor/
nakedmud-mod/src/example_module/
nakedmud-mod/src/help2/
nakedmud-mod/src/set_val/
nakedmud-mod/src/socials/
nakedmud-mod/src/time/
#ifndef COMMAND_H
#define COMMAND_H
//*****************************************************************************
//
// command.h
//
// A structure that holds all of the data tied to player commands. 
// Specifically, the function that is executed and all of the restrictions on
// its execution. For commands that are written as python functions, newPyCmd
// is used, with the python function replacing the C function. The Python
// function should take the same 3 arguments.
//
//*****************************************************************************

typedef struct cmd_data CMD_DATA;

#define CMD_PTR(name) \
  void (* name)(CHAR_DATA *ch, const char *cmd, char *arg)
#define COMMAND(name) \
  void name(CHAR_DATA *ch, const char *cmd, char *arg)
#define CMD_CHK_PTR(name) \
  bool (* name)(CHAR_DATA *ch, const char *cmd) 
#define CMD_CHK(name) \
  bool name(CHAR_DATA *ch, const char *cmd)

CMD_DATA   *newCmd(const char *name, COMMAND(func), const char *user_group,
		   bool interrupts);
CMD_DATA *newPyCmd(const char *name, void  *pyfunc, const char *user_group,
		   bool interrupts);

//
// change our information, without changing our checks
void   cmdUpdate(CMD_DATA *cmd, COMMAND(func), const char *user_group, 
		 bool interrupts);
void cmdPyUpdate(CMD_DATA *cmd, void *pyfunc, const char *user_group,
		 bool interrupts);

void     deleteCmd(CMD_DATA *cmd);
CMD_DATA  *cmdCopy(CMD_DATA *cmd);
void     cmdCopyTo(CMD_DATA *from, CMD_DATA *to);

//
// -1     did not attempt; no command but all checks passed (fail)
//  0     attempted, but a check stopped it (success)
//  1     attempted, and succeeded (success)
int charTryCmd(CHAR_DATA *ch, CMD_DATA *cmd, char *arg);

const char      *cmdGetName(CMD_DATA *cmd);
const char *cmdGetUserGroup(CMD_DATA *cmd);
bool       cmdGetInterrupts(CMD_DATA *cmd);
void            cmdAddCheck(CMD_DATA *cmd, CMD_CHK(func));
void          cmdAddPyCheck(CMD_DATA *cmd, void *pyfunc);

//
// do we have an associated function, or are we just a list of command checks?
bool cmdHasFunc(CMD_DATA *cmd);

CMD_CHK(chk_can_move);     // ensures the person is standing
CMD_CHK(chk_conscious);    // ensures the person is conscious
CMD_CHK(chk_grounded);     // ensures the person is on the ground
CMD_CHK(chk_not_mob);      // ensures the person is not an NPC

#endif // COMMAND_H