player.h 949 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* $Id: plugins.h,v 1.12 2001/05/05 17:58:10 kilobug Exp $ */
  2. #ifndef __PROLO_PLUGINS_H__
  3. #define __PROLO_PLUGINS_H__
  4. #include "conf.h"
  5. typedef struct player_t
  6. {
  7. const char *name;
  8. /* Function exported by the player module */
  9. void (*init)(int team, int nbPlayers);
  10. void (*new_turn)(int turn);
  11. void (*akx_turn)(int id);
  12. void (*r4d2_turn)(int id);
  13. float score;
  14. int team_id;
  15. int time_turn;
  16. int last_time;
  17. boolean_t on;
  18. GModule *handle;
  19. int error;
  20. int new;
  21. pid_t pid;
  22. int pipe_read;
  23. int pipe_write;
  24. boolean_t alive;
  25. } player_t;
  26. extern player_t *glbPlayer;
  27. player_t *player_new(const char *libname, const char *name, int id, conf_t *conf);
  28. void player_destroy(player_t *player);
  29. void player_init(player_t *p, int team_id);
  30. void player_new_turn(player_t *p, int turn_num);
  31. void player_turn_akx(player_t *p, int akx_id);
  32. void player_turn_r4d2(player_t *p, int r4d2_id);
  33. #endif