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