KarteAuswahl.h 2.6 KB

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