home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / gcc / cc1obj / !gcc / files / h / Fishie next >
Text File  |  1996-02-07  |  1KB  |  51 lines

  1. /*
  2.  * You may freely copy, distribute and reuse the code in this example.
  3.  * NeXT disclaims any warranty of any kind, expressed or implied, as to its
  4.  * fitness for any particular use.
  5.  */
  6.  
  7.  
  8.  
  9.     /* always import the superclass .h file!! We could do this in our .m file,
  10.         but since we ALWAYS need to do it, we take care of it here and forget
  11.         about it */
  12. #include <objc/Object.h>
  13.  
  14.  
  15. @interface Fishie:Object
  16.  
  17.     /* instance variables of the Fish class */
  18. {
  19.     int size;        /* the current size of the Fish */
  20.     int hLoc, vLoc;    /* horizontal and vertical position of fish */
  21.     BOOL isHappy;    /* is our fish happy or not? */
  22. }
  23.  
  24.  
  25.     /* methods of the Fish class */
  26.  
  27.     /* here are some general methods like read, write, init, etc;
  28.     we're LAZY, so we only implement init at this time (boo!) */
  29. - init;
  30.  
  31.     /* here are some methods which return the value of the appropriate
  32.         instance var */
  33. - (int) size;
  34. - (int) hLoc;
  35. - (int) vLoc;
  36. - (BOOL) isHappy;
  37.  
  38.     /* here are some methods which change the values of some instance
  39.         vars */
  40. - setSize:(int) val;
  41. - setHLoc:(int) val;
  42. - setVLoc:(int) val;
  43. - setIsHappy:(BOOL) val;
  44.  
  45.     /* here are some special-purpose methods */
  46. - swim;
  47. - incHBy:(int) val;        /* increment/decrement horizontal pos */
  48. - incVBy:(int) val;
  49.  
  50. @end
  51.