home *** CD-ROM | disk | FTP | other *** search
/ C++ Games Programming / CPPGAMES.ISO / thx / include / handler.h < prev    next >
C/C++ Source or Header  |  1995-05-08  |  541b  |  31 lines

  1. // ------------ handler.h
  2.  
  3. #ifndef  HANDLER_H
  4. #define  HANDLER_H
  5.  
  6. #include <mem.h>
  7. #include "hand.h"
  8. #include "linklist.h"
  9.  
  10. struct subscription  {
  11.   Hand* hand;
  12.   callback cb;
  13.   subscription(Hand*h, callback c) : hand(h), cb(c)
  14.     { }
  15. };
  16.  
  17. class EventHandler  {
  18. public:
  19.   ~EventHandler()
  20.     { reset(); }
  21.   void add(Hand*,callback);
  22.   void del(Hand*,callback);
  23.   void delHand(Hand*);
  24.   void execute_callbacks(int p1=0, int p2=0, int p3=0);
  25.   void reset();
  26.   int getnum();
  27.   LinkedList<subscription> slist;
  28. };
  29.  
  30. #endif
  31.