Guest User

Untitled

a guest
Jul 19th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /* GameEngine.m, assume GameEngine.h is complete */
  2.  
  3. #import "GameEngine.h"
  4. #import "TouchHandler.h"
  5.  
  6. @implementation GameEngine
  7.  
  8. -(id) init
  9. {
  10. if(( self = [super init] ))
  11. {
  12. TouchHandler* touch = [[TouchHandler alloc] initWithTarget: self];
  13. [[TouchDispatcher sharedDispatcher] addTargetedDelegate: touch priority: 0 swallowsTouches: YES];
  14. }
  15.  
  16. return self;
  17. }
  18.  
  19. @end
  20.  
  21. /* TouchHandler.m, assume TouchHandler.h is complete */
  22.  
  23. @implementation TouchHandler
  24.  
  25. @synthesize target;
  26.  
  27. -(id) initWithTarget: (GameEngine*)newTarget
  28. {
  29. if(( self = [super init] ))
  30. {
  31. [self setTarget: newTarget];
  32. }
  33.  
  34. return self;
  35. }
  36.  
  37. //
  38. // Events go here, I don't really need to list them all
  39. //
  40.  
  41. @end
Add Comment
Please, Sign In to add comment