VideoBestenliste.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #ifndef VideoBestenliste_H
  2. #define VideoBestenliste_H
  3. #include <TextFeld.h>
  4. #include <Array.h>
  5. using namespace Framework;
  6. class VideoSpieler; // VideoSpieler.h
  7. class VideoBLSpieler
  8. {
  9. private:
  10. int sNum;
  11. int farbe;
  12. int p;
  13. int nP;
  14. LRahmen *rahmen;
  15. TextFeld *name;
  16. TextFeld *punkte;
  17. TextFeld *neuPunkte;
  18. TextFeld *status;
  19. Array< int > *rundenNP;
  20. int runde;
  21. int ref;
  22. public:
  23. // Konstruktor
  24. VideoBLSpieler( int sNum, int farbe, Schrift *zS );
  25. // Destruktor
  26. ~VideoBLSpieler();
  27. // nicht constant
  28. bool updateStatus( VideoSpieler *zSpieler );
  29. void setPunkte( int p );
  30. void addPunkt( bool plus );
  31. void updatePunkte( bool vorwärts );
  32. void render( int y, Bild &zRObj );
  33. // constant
  34. int getSpielerNummer() const;
  35. int getPunkte() const;
  36. // Reference Counting
  37. VideoBLSpieler *getThis();
  38. VideoBLSpieler *release();
  39. };
  40. class VideoBLTeam
  41. {
  42. private:
  43. int teamId;
  44. int spielerAnzahl;
  45. int p;
  46. int mP;
  47. int nP;
  48. int farbe;
  49. Schrift *schrift;
  50. LRahmen *rahmen;
  51. RCArray< VideoBLSpieler > *spieler;
  52. TextFeld *name;
  53. TextFeld *punkte;
  54. TextFeld *neuPunkte;
  55. TextFeld *status;
  56. Array< int > *rundenNP;
  57. int runde;
  58. int ref;
  59. public:
  60. // Konstruktor
  61. VideoBLTeam( int id, int farbe, Schrift *s, char *n );
  62. // Destruktor
  63. ~VideoBLTeam();
  64. // nicht constant
  65. bool addSpieler( VideoSpieler *zSpieler );
  66. bool updateSpielerStatus( VideoSpieler *zSpieler );
  67. void setStatus( const char *txt, int f );
  68. void setPunkte( int p );
  69. void setMaxPunkte( int mP );
  70. bool setSpielerPunkte( int sNum, int p );
  71. void addPunkt( bool plus );
  72. bool addPunkt( int sNum, bool plus );
  73. void updatePunkte( bool vorwärts );
  74. void render( int y, Bild &zRObj );
  75. // constant
  76. int getSpielerAnzahl() const;
  77. int getPunkte() const;
  78. int getHeight() const;
  79. bool hatGewonnen() const;
  80. int getSpielerPunkte( int sNum ) const;
  81. // Reference Counting
  82. VideoBLTeam *getThis();
  83. VideoBLTeam *release();
  84. };
  85. class VideoBestenliste
  86. {
  87. private:
  88. LRahmen *rahmen;
  89. RCArray< VideoBLTeam > *teams;
  90. TextFeld *name;
  91. TextFeld *punkte;
  92. TextFeld *neuPunkte;
  93. TextFeld *status;
  94. VScrollBar *scroll;
  95. Schrift *schrift;
  96. bool update;
  97. int teamAnzahl;
  98. int ref;
  99. public:
  100. // Konstruktor
  101. VideoBestenliste( Schrift *s );
  102. // Destruktor
  103. ~VideoBestenliste();
  104. // nicht constant
  105. void setTeamAnzahl( int anz );
  106. void addSpieler( VideoSpieler *zSpieler );
  107. void updateSpielerStatus( VideoSpieler *zSpieler );
  108. void setTeamStatus( int team, const char *txt, int f );
  109. void setTeamPunkte( int teamId, int punkte );
  110. void setTeamMaxPunkte( int teamId, int mPunkte );
  111. void setSpielerPunkte( int teamNum, int sNum, int punkte );
  112. void addPunkt( int tNum, bool plus );
  113. void addPunkt( int tNum, int sNum, bool plus );
  114. void updatePunkte( bool vorwärts = 1 );
  115. void doMausEreignis( MausEreignis &me );
  116. void render( Bild &zRObj );
  117. // constant
  118. int getTeamAnzahl() const;
  119. bool teamExistiert( int team ) const;
  120. int getTeamPunkte( int team ) const;
  121. bool hatTeamGewonnen( int team ) const;
  122. int getSpielerPunkte( int team, int sNum ) const;
  123. // Reference Counting
  124. VideoBestenliste *getThis();
  125. VideoBestenliste *release();
  126. };
  127. #endif