Advertisement
Guest User

Untitled

a guest
Aug 31st, 2017
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.34 KB | None | 0 0
  1. class Entity {
  2. public:
  3.     virtual ~Entity() { }
  4.    
  5.     virtual void Touch( Entity *e )
  6.     {
  7.     }
  8. };
  9.  
  10. class Player : public Entity
  11. {
  12. public:
  13.     //....
  14. };
  15.  
  16. class Item : public Entity {
  17. public:
  18.     virtual void Touch( Entity *e )
  19.     {
  20.         if( e->type == Player::type )
  21.         {
  22.             //...
  23.         }
  24.     }
  25. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement