tabtenn1.h 906 B

12345678910111213141516171819202122232425262728293031323334
  1. // tabtenn1.h -- a table-tennis base class
  2. #ifndef TABTENN1_H_
  3. #define TABTENN1_H_
  4. #include <string>
  5. using std::string;
  6. // simple base class
  7. class TableTennisPlayer
  8. {
  9. private:
  10. string firstname;
  11. string lastname;
  12. bool hasTable;
  13. public:
  14. TableTennisPlayer (const string & fn = "none",
  15. const string & ln = "none", bool ht = false);
  16. void Name() const;
  17. bool HasTable() const { return hasTable; };
  18. void ResetTable(bool v) { hasTable = v; };
  19. };
  20. // simple derived class
  21. class RatedPlayer : public TableTennisPlayer
  22. {
  23. private:
  24. unsigned int rating;
  25. public:
  26. RatedPlayer (unsigned int r = 0, const string & fn = "none",
  27. const string & ln = "none", bool ht = false);
  28. RatedPlayer(unsigned int r, const TableTennisPlayer & tp);
  29. unsigned int Rating() const { return rating; }
  30. void ResetRating (unsigned int r) {rating = r;}
  31. };
  32. #endif