home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_08_10 / 8n10067a < prev    next >
Text File  |  1990-08-26  |  492b  |  25 lines

  1. /* Debugging Objects with Turbo Debugger 
  2.  
  3. add the following line to the public part of the Queen class declaration:
  4.  
  5.     void eatFood( int nUnits );
  6.  
  7. (i.e., the line before the closing brace of the declaration!)
  8. */
  9.  
  10. // Add the following function definition to the file ANTHILL.CPP:
  11.  
  12. void Queen::eatFood( int nUnits )
  13. {
  14. if (nEnergy < 20000)
  15.     Consumer::eatFood( nUnits );
  16. else    {
  17.     int oldX = nX;
  18.     int oldY = nY;
  19.     move();
  20.     showFood( oldX, oldY, TRUE );
  21.     }
  22. }
  23. // end of file
  24.  
  25.