SpielAuswahl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef SpielAuswahl_H
  2. #define SpielAuswahl_H
  3. #include <Klient.h>
  4. #include <Bild.h>
  5. #include <Thread.h>
  6. #include <TextFeld.h>
  7. #include <Animation.h>
  8. #include <KSGScript.h>
  9. #include <Rahmen.h>
  10. using namespace Framework;
  11. using namespace KSGScript;
  12. class SpielDaten; // aus dieser Datei
  13. class SpielDaten
  14. {
  15. private:
  16. class Loader : public Thread
  17. {
  18. private:
  19. SpielDaten * sd;
  20. bool beenden;
  21. int aktion;
  22. public:
  23. Loader( SpielDaten *sd, int aktion );
  24. void setBeenden();
  25. void thread() override;
  26. Loader *release();
  27. int getAktion() const;
  28. };
  29. Loader *loader;
  30. int spielId;
  31. Text *name;
  32. Bild *hintergrund;
  33. Animation2D *aAnimation;
  34. Schrift *schrift;
  35. TextRenderer *tr;
  36. KSGScriptObj *beschreibung;
  37. HINSTANCE ksgs;
  38. LRahmen *rahmen;
  39. double tickVal;
  40. int animation;
  41. bool ausgewählt;
  42. Punkt pos;
  43. Punkt gr;
  44. int geladen;
  45. AlphaFeld *auswahl;
  46. int ladenBild;
  47. bool rend;
  48. bool erlaubt;
  49. unsigned char tAlpha;
  50. unsigned char alpha;
  51. int ref;
  52. public:
  53. // Konstruktor
  54. SpielDaten( Schrift *zSchrift, const char *name, int id );
  55. // Destruktor
  56. ~SpielDaten();
  57. // nicht constant
  58. void ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVariable **retVal );
  59. void updateErlaubt();
  60. void setSichtbar( bool sichtbar );
  61. void setSichtbar();
  62. void setAuswahl( bool auswahl );
  63. void setPosition( int lPos );
  64. bool tick( double tickVal );
  65. void doPublicMausEreignis( MausEreignis &me );
  66. void render( Bild &zRObj );
  67. // constant
  68. int getSpielId() const;
  69. bool istausgewählt() const;
  70. Text *zName() const;
  71. bool istErlaubt() const;
  72. // Reference Counting
  73. SpielDaten *getThis();
  74. SpielDaten *release();
  75. };
  76. class SpielAuswahlFenster : public Thread
  77. {
  78. private:
  79. int anzahl;
  80. int auswahl;
  81. RCArray< SpielDaten > *members;
  82. LRahmen *rahmen;
  83. Schrift *schrift;
  84. TextRenderer *tr;
  85. double tickVal;
  86. int animation;
  87. Punkt pos;
  88. Punkt gr;
  89. int seite;
  90. bool rend;
  91. unsigned char alpha;
  92. public:
  93. // Konstruktor
  94. SpielAuswahlFenster( Schrift *zSchrift );
  95. // Destruktor
  96. ~SpielAuswahlFenster();
  97. // nicht constant
  98. void setSichtbar( bool sichtbar );
  99. void blättern( bool oben );
  100. void updateListe();
  101. virtual void thread();
  102. bool tick( double tickVal );
  103. void doPublicMausEreignis( MausEreignis &me );
  104. void render( Bild &zrObj );
  105. // constant
  106. int getAnzahl() const;
  107. int getSeiteAnzahl() const;
  108. int getSeite() const;
  109. int getAnzahlAufSeite() const;
  110. bool hatAuswahl() const;
  111. SpielDaten *getAuswahl() const;
  112. SpielDaten *zAuswahl() const;
  113. bool istAuswahlErlubt() const;
  114. // löscht das objekt wenn es nicht mehr gebraucht wird und beendet den Thread
  115. Thread *release() override;
  116. };
  117. #endif