Advertisement
C0BRA

Idea

Apr 14th, 2013
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. class CTestEntity : CBaseEntity
  2. {
  3.     CHookHandle m_ThinkHook;
  4.    
  5.     void Think()
  6.     {
  7.         cout << "Think\n";
  8.     }
  9. public:
  10.     CTestEntity()
  11.     {
  12.         m_ThinkHook = hooks.Think.Register(std::bind(CTestEntity::Think, this));
  13.     }
  14. }
  15.  
  16. // defined as
  17.  
  18. class hooks
  19. {
  20.     static CHook<void(void)> Think;
  21. }
  22.  
  23. // called as
  24.  
  25. void GameThink()
  26. {
  27.     hooks.Think();
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement