home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / ratingsy.h < prev    next >
C/C++ Source or Header  |  1998-04-25  |  3KB  |  99 lines

  1. /***********************************************************************
  2. **      R A T I N G . H                                                *
  3. **                                                                     *
  4. ************************************************************************
  5. ** Copyright (C) 1996 by Microsoft Corporation                         *
  6. **                 All Rights Reserved                                 *
  7. ************************************************************************/
  8. /*
  9.  
  10.         RATING.H
  11.  
  12.         Rating record object class definitions for Microsoft Guide
  13.  
  14.  
  15.  
  16. */
  17.  
  18.  
  19.  
  20. #ifndef _RATINGSYSTEM_H_
  21. #define _RATINGSYSTEM_H_
  22.  
  23.  
  24. #include "dbsets.h"
  25.  
  26.  
  27. /*
  28.  
  29. Rating objects are constructed from database records of the RatingSystem table.
  30.  
  31. The CRatingSystemRecordset class is used to select and create CRatingSystem objects
  32. from the RatingSystem table via functions in the CDatabaseRecordset parent class.
  33.  
  34. */
  35.  
  36.  
  37. class COMMMSTVEXPORT CRatingSystemRecordset : public CDatabaseRecordset
  38. {
  39. // This class provides RatingSystem recordset manipulation via parent functions
  40.  
  41.     virtual CString GetTableName(VOID);
  42.  
  43.     virtual BOOL    SetRecordsetObject(VOID *cRecordsetObject);
  44.  
  45. public:
  46. virtual VOID*   GetRecordsetObject(VOID);
  47. virtual BOOLEAN Seek(LPCTSTR lpszComparison, CObject &coo);
  48. virtual BOOLEAN Seek(LPCTSTR lpszComparison, LONG lRatingSystemID);
  49. };
  50.  
  51.  
  52. class COMMMSTVEXPORT CRatingSystem : public CObject
  53. {
  54.     friend class CRatingSystemRecordset; // generates the CRating record object
  55.  
  56. private:
  57.  
  58.     LONG            m_lRatingSystemID;
  59.     LONG            m_lTuningSpace;
  60.     CString         m_cszName;
  61.     CString         m_cszDescription;
  62.     
  63. public:
  64.             CRatingSystem(LONG lRatingSystemID = AFX_RFX_LONG_PSEUDO_NULL,
  65.                             LONG lTuningSpace = 0,
  66.                             CString cszName = "",
  67.                             CString cszDescription = "") :
  68.                             m_lRatingSystemID(lRatingSystemID),
  69.                             m_lTuningSpace(lTuningSpace),
  70.                             m_cszName(cszName),
  71.                             m_cszDescription(cszDescription){ }
  72.             ~CRatingSystem(VOID) { }
  73.  
  74.     VOID    SetTuningSpace( LONG lTuningSpace) { m_lTuningSpace = lTuningSpace; }
  75.     VOID    SetName( LPCTSTR cszName) { m_cszName = cszName; }
  76.     VOID    SetDescription( LPCTSTR cszDescription) { m_cszDescription = cszDescription; }
  77.  
  78.     LONG            RatingSystemID() { return m_lRatingSystemID; }
  79.     LONG            TuningSpace() { return m_lTuningSpace; }
  80.     CString         Name() { return m_cszName; }
  81.     CString         Description() { return m_cszDescription; }
  82. };
  83.  
  84.  
  85. // Table: Rating
  86.  
  87. #define  TBL_RatingSystem  _T("[Rating System]")
  88.  
  89. //      Field:                                    Name                    Type        Size
  90.  
  91. #define FLD_RatingSystem_RatingSystemID        _T("RS Rating System ID")    // Long        4
  92. #define FLD_RatingSystem_TuningSpace        _T("RS Tuning Space")        // Long        4
  93. #define FLD_RatingSystem_Name                _T("RS Name")                // Text        255
  94. #define FLD_RatingSystem_Description        _T("RS Description")        // Text     50
  95.  
  96. #endif
  97.  
  98.  
  99.