home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / XenonSource.exe / gamesystem / includes / gs_scoretable.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-10  |  1.5 KB  |  79 lines

  1. //-------------------------------------------------------------
  2. //
  3. // Class:    gsCScoreTable
  4. //
  5. // Author:    John M Phillips
  6. //
  7. // Started:    12/03/00
  8. //
  9. // Base:    gsCObject
  10. //
  11. // Derived:    None
  12. //
  13. //-------------------------------------------------------------
  14.  
  15. #ifndef _INCLUDE_GS_SCORETABLE_H
  16. #define _INCLUDE_GS_SCORETABLE_H
  17.  
  18. #include "gs_object.h"
  19. #include "gs_list.h"
  20.  
  21. //-------------------------------------------------------------
  22.  
  23. const int gsSCORE_NAME_SIZE = 3;
  24.  
  25. //-------------------------------------------------------------
  26.  
  27. struct gsScoreItem
  28. {
  29.     int m_score;
  30.     char m_name[gsSCORE_NAME_SIZE];
  31. };
  32.  
  33. //-------------------------------------------------------------
  34.  
  35. class gsCScoreTable : public gsCObject
  36. {
  37.     private:
  38.         gsCList<gsScoreItem *> m_score_list;
  39.  
  40.         gsCPoint m_position;
  41.         gsCPoint m_spacing;
  42.         gsCFont *m_font;
  43.  
  44.         int m_current_item;
  45.         int m_current_letter;
  46.  
  47.         gsCTimer m_flash_timer;
  48.  
  49.         void destroy();
  50.  
  51.     public:
  52.         gsCScoreTable();
  53.         ~gsCScoreTable();
  54.  
  55.         void setPosition(const gsCPoint& position);
  56.         void setSpacing(const gsCPoint& spacing);
  57.         void setFont(gsCFont *font);
  58.  
  59.         void setSize(int size);
  60.  
  61.         int insertScore(int score,const char *name);
  62.  
  63.         void setCurrentItem(int item);
  64.         void setCurrentLetter(int letter);
  65.         void cycleLetter(int dir);
  66.         void scrollLetter(int dir);
  67.  
  68.         int getCurrentItem();
  69.  
  70.         int getScore(int index);
  71.         const char *getName(int index);
  72.  
  73.         bool draw();
  74. };
  75.  
  76. //-------------------------------------------------------------
  77.  
  78. #endif
  79.