#ifndef KESSVorschau_H
#define KESSVorschau_H

#include <AuswahlBox.h>
#include <KSGScript.h>
#include <Rahmen.h>
#include <Thread.h>

using namespace Framework;
using namespace KSGScript;

class KESSVorschauKarteScript : public Thread
{
private:
    KSGScriptObj* fenster;
    Punkt pos;
    LRahmen* ram;
    HINSTANCE ksgs;
    Text pfad;
    bool sichtbar;
    bool besitztTestVersion;
    int verbleibend;
    bool vollversionErwerbbar;
    bool testversionErwerbbar;
    int vvPreis;
    int tvPreis;
    int kupfer;
    unsigned char alpha;
    bool aktion;
    int ak;

public:
    // Konstruktor
    KESSVorschauKarteScript(TextFeld* zLog);
    // Destruktor
    ~KESSVorschauKarteScript();
    // nicht constant
    void thread() override;
    void setScriptParams(
        bool hatTV, int tvVerb, bool vvEn, bool tvEn, int vvK, int tvK, int k);
    void ladeKarteSeite(const char* pfad);
    void ksgsAktion(RCArray<KSGSVariable>* parameter, KSGSVariable** retVal);
    void doPublicMausEreignis(MausEreignis& me);
    void doTastaturEreignis(TastaturEreignis& te);
    bool tick(double zeit);
    void render(Bild& zRObj);
};

class KESSVorschauKarte : public virtual ReferenceCounter
{
private:
    Knopf* ausw�hlen;
    Bild* hintergrund;
    AlphaFeld* ausgew�hlt;
    LRahmen* ram;
    bool ausw;
    bool rend;

public:
    // Konstruktor
    KESSVorschauKarte();
    // Destruktor
    ~KESSVorschauKarte();
    // nicht constant
    void ladeKarte(const char* pfad);
    bool doPublicMausEreignis(MausEreignis& me);
    bool tick(double zeit);
    void render(Bild& zRObj);
};

class KESSVorschau : public Zeichnung
{
private:
    TextRenderer* tr;
    KESSVorschauKarteScript* script;
    KESSVorschauKarte* karte;
    Knopf* beenden;
    AuswahlBox* besitztTestVersion;
    TextFeld* spieleVerbleibend;
    AuswahlBox* vvErwerbbar;
    AuswahlBox* tvErwerbbar;
    TextFeld* vvPreis;
    TextFeld* tvPreis;
    TextFeld* kupfer;
    Text pfad;
    TextFeld* log;
    unsigned char alpha;
    bool sichtbar;
    double tickVal;
    int aktion;
    bool rend;

public:
    // Konstruktor
    KESSVorschau();
    // Destruktor
    ~KESSVorschau();
    // nicht constant
    int getAktion();
    void ladeKarte(const char* pfad);
    void setSichtbar(bool sicht);
    void doPublicMausEreignis(MausEreignis& me);
    void doTastaturEreignis(TastaturEreignis& te);
    bool tick(double zeit);
    void render(Bild& zRObj);
    // constant
    bool istSichtbar() const;
};

#endif