SpielAuswahl.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. int ref;
  23. public:
  24. Loader( SpielDaten *sd, int aktion );
  25. void setBeenden();
  26. void thread() override;
  27. Loader *release();
  28. int getAktion() const;
  29. };
  30. Loader *loader;
  31. int spielId;
  32. Text *name;
  33. Bild *hintergrund;
  34. Animation2D *aAnimation;
  35. Schrift *schrift;
  36. TextRenderer *tr;
  37. KSGScriptObj *beschreibung;
  38. HINSTANCE ksgs;
  39. LRahmen *rahmen;
  40. double tickVal;
  41. int animation;
  42. bool ausgewählt;
  43. Punkt pos;
  44. Punkt gr;
  45. int geladen;
  46. AlphaFeld *auswahl;
  47. int ladenBild;
  48. bool rend;
  49. bool erlaubt;
  50. unsigned char tAlpha;
  51. unsigned char alpha;
  52. int ref;
  53. public:
  54. // Konstruktor
  55. SpielDaten( Schrift *zSchrift, const char *name, int id );
  56. // Destruktor
  57. ~SpielDaten();
  58. // nicht constant
  59. void ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVariable **retVal );
  60. void updateErlaubt();
  61. void setSichtbar( bool sichtbar );
  62. void setSichtbar();
  63. void setAuswahl( bool auswahl );
  64. void setPosition( int lPos );
  65. bool tick( double tickVal );
  66. void doMausEreignis( MausEreignis &me );
  67. void render( Bild &zRObj );
  68. // constant
  69. int getSpielId() const;
  70. bool istausgewählt() const;
  71. Text *zName() const;
  72. bool istErlaubt() const;
  73. // Reference Counting
  74. SpielDaten *getThis();
  75. SpielDaten *release();
  76. };
  77. class SpielAuswahlFenster : private Thread
  78. {
  79. private:
  80. int anzahl;
  81. int auswahl;
  82. RCArray< SpielDaten > *members;
  83. LRahmen *rahmen;
  84. Schrift *schrift;
  85. TextRenderer *tr;
  86. double tickVal;
  87. int animation;
  88. Punkt pos;
  89. Punkt gr;
  90. int seite;
  91. bool rend;
  92. unsigned char alpha;
  93. int ref;
  94. public:
  95. // Konstruktor
  96. SpielAuswahlFenster( Schrift *zSchrift );
  97. // Destruktor
  98. ~SpielAuswahlFenster();
  99. // nicht constant
  100. void setSichtbar( bool sichtbar );
  101. void blättern( bool oben );
  102. void updateListe();
  103. virtual void thread();
  104. bool tick( double tickVal );
  105. void doMausEreignis( MausEreignis &me );
  106. void render( Bild &zrObj );
  107. // constant
  108. int getAnzahl() const;
  109. int getSeiteAnzahl() const;
  110. int getSeite() const;
  111. int getAnzahlAufSeite() const;
  112. bool hatAuswahl() const;
  113. SpielDaten *getAuswahl() const;
  114. SpielDaten *zAuswahl() const;
  115. bool istAuswahlErlubt() const;
  116. // Reference Counting
  117. SpielAuswahlFenster *getThis();
  118. SpielAuswahlFenster *release();
  119. };
  120. #endif