home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / cprog / ev_201.zip / HANOI.ZIP / TDISK.HPP < prev    next >
C/C++ Source or Header  |  1993-07-03  |  3KB  |  77 lines

  1. #if !defined (TDISK)                 // Prevents multiple declarations errors
  2. #define TDISK
  3.  
  4.  
  5. /*
  6.    Module        : TDISK.HPP
  7.    Version       : 2.0
  8.    Revision date : July 3rd, 1993
  9.    Author(s)     : Remy Gendron
  10.  
  11.    Description   : tdisk class declaration.
  12. */
  13.  
  14.  
  15. // Headers ------------------------------------------------------------------
  16.  
  17. #include "twindow.hpp"                                       // Other modules
  18.  
  19.  
  20. // Macros -------------------------------------------------------------------
  21.  
  22. #include "stdmacro.h"                           // Standard macro definitions
  23.  
  24.  
  25. // TypeDefs -----------------------------------------------------------------
  26.  
  27. #include "stdtype.h"                             // Standard type definitions
  28. #include "prjtype.h"                       // This project's type definitions
  29.  
  30.  
  31. // Prototypes ---------------------------------------------------------------
  32.  
  33. class tdisk                                                    // Disk object
  34. {
  35.    int   id ;                               // Disk's ID (1..10), 1 = largest
  36.    int   color ;                                              // Disk's color
  37.    int   row ;                           // Disk's current position in window
  38.    int   col ;
  39.    twindow huge *winptr ;                               // Ptr to work window
  40.  
  41.  
  42. public:
  43.  
  44. tdisk                                                          // Constructor
  45. (
  46.    int           did,                                            // Disk's id
  47.    int           drow,                             // Initial disk's position
  48.    int           dcol,
  49.    twindow huge *twinptr                                // Ptr to work window
  50. ) ;
  51.  
  52. ~tdisk () ;                                                     // Destructor
  53.  
  54. void tdisk::show () ;                    // Displays disk at current position
  55.  
  56. void tdisk::erase                        // Erases disk from current position
  57. (
  58.    int towercolor                                            // Tower's color
  59. ) ;
  60.  
  61. void tdisk::moveto                     // Moves disk from on tower to another
  62. (
  63.    int target_row,                                         // Destination row
  64.    int target_col,                                         // Destination col
  65.    int source_color,                                  // Source tower's color
  66.    int target_color,                             // Destination tower's color
  67.    int speed                                             // Animation's speed
  68. ) ;
  69.  
  70.  
  71. } ;
  72.  
  73.  
  74. // End Header File ----------------------------------------------------------
  75.  
  76. #endif
  77.