UpdateGUI.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. #ifndef UpdateGUI_H
  2. #define UpdateGUI_H
  3. #include "../../Netzwerk/Patcher.h"
  4. #include <Fortschritt.h>
  5. #include <Knopf.h>
  6. #include <Array.h>
  7. #include <Thread.h>
  8. using namespace Framework;
  9. class UpdateGUI : private Thread
  10. {
  11. private:
  12. Patcher *p;
  13. TextFeld *updateStatus;
  14. Knopf *updateStarten;
  15. FBalken *updateFortschritt;
  16. bool updateAbbrechen;
  17. bool sichtbar;
  18. int alpha;
  19. int spielId;
  20. int dg;
  21. int ref;
  22. public:
  23. // Konstruktor
  24. UpdateGUI( Schrift *zSchrift, int spielId, int dg = 0 );
  25. // Destruktor
  26. ~UpdateGUI();
  27. // nicht constant
  28. void setSichtbar( bool sichtbar );
  29. void doMausEreignis( MausEreignis &me, Patcher *zP );
  30. bool tick( double zeit );
  31. void render( int xOff, int yOff, Bild &zRObj );
  32. void thread();
  33. // constant
  34. bool istGleich( int spielId, int dg = 0 );
  35. // Reference Counting
  36. UpdateGUI *getThis();
  37. UpdateGUI *release();
  38. };
  39. class UpdateHandler
  40. {
  41. private:
  42. Patcher *patcher;
  43. RCArray< UpdateGUI > *updates;
  44. Critical cs;
  45. int ref;
  46. // privat
  47. void lock();
  48. void unlock();
  49. public:
  50. // Konstruktor
  51. UpdateHandler();
  52. // Destruktor
  53. ~UpdateHandler();
  54. // nicht constant
  55. void erstellen( Schrift *zSchrift, int spiel, int dg = 0 );
  56. void setSichtbar( int spiel, bool sichtbar, int dg = 0 );
  57. void doMausEreignis( int spiel, MausEreignis &me, int dg = 0 );
  58. bool tick( int spiel, double zeit, int dg = 0 );
  59. void render( int spiel, int xOff, int yOff, Bild &zRObj, int dg = 0 );
  60. void remove( int spiel, int dg = 0 );
  61. bool hat( int spiel, int dg = 0 );
  62. // Reference Counting
  63. UpdateHandler *getThis();
  64. UpdateHandler *release();
  65. };
  66. #endif