d_think.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // Emacs style mode select -*- C++ -*-
  2. //-----------------------------------------------------------------------------
  3. //
  4. // $Id:$
  5. //
  6. // Copyright (C) 1993-1996 by id Software, Inc.
  7. //
  8. // This source is available for distribution and/or modification
  9. // only under the terms of the DOOM Source Code License as
  10. // published by id Software. All rights reserved.
  11. //
  12. // The source is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
  15. // for more details.
  16. //
  17. // DESCRIPTION:
  18. // MapObj data. Map Objects or mobjs are actors, entities,
  19. // thinker, take-your-pick... anything that moves, acts, or
  20. // suffers state changes of more or less violent nature.
  21. //
  22. //-----------------------------------------------------------------------------
  23. #ifndef __D_THINK__
  24. #define __D_THINK__
  25. #ifdef __GNUG__
  26. #pragma interface
  27. #endif
  28. //
  29. // Experimental stuff.
  30. // To compile this as "ANSI C with classes"
  31. // we will need to handle the various
  32. // action functions cleanly.
  33. //
  34. typedef void (*actionf_v)();
  35. typedef void (*actionf_p1)( void* );
  36. typedef void (*actionf_p2)( void*, void* );
  37. typedef union
  38. {
  39. actionf_p1 acp1;
  40. actionf_v acv;
  41. actionf_p2 acp2;
  42. } actionf_t;
  43. // Historically, "think_t" is yet another
  44. // function pointer to a routine to handle
  45. // an actor.
  46. typedef actionf_t think_t;
  47. // Doubly linked list of actors.
  48. typedef struct thinker_s
  49. {
  50. struct thinker_s* prev;
  51. struct thinker_s* next;
  52. think_t function;
  53. } thinker_t;
  54. #endif
  55. //-----------------------------------------------------------------------------
  56. //
  57. // $Log:$
  58. //
  59. //-----------------------------------------------------------------------------