#ifndef KESSVorschau_H
#define KESSVorschau_H

#include <KSGScript.h>
#include <AuswahlBox.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;
    int ref;

public:
    // Konstruktor
    KESSVorschauKarteScript( Schrift *zSchrift, 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( char *pfad );
    void ksgsAktion( RCArray< KSGSVariable > *parameter, KSGSVariable **retVal );
    void doMausEreignis( MausEreignis &me );
    void doTastaturEreignis( TastaturEreignis &te );
    bool tick( double zeit );
    void render( Bild &zRObj );
    // Reference Counting
    KESSVorschauKarteScript *getThis();
    KESSVorschauKarteScript *release();
};

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

public:
    // Konstruktor
    KESSVorschauKarte( Schrift *schrift );
    // Destruktor
    ~KESSVorschauKarte();
    // nicht constant
    void ladeKarte( char *pfad );
    bool doMausEreignis( MausEreignis &me );
    bool tick( double zeit );
    void render( Bild &zRObj );
    // Reference Counting
    KESSVorschauKarte *getThis();
    KESSVorschauKarte *release();
};

class KESSVorschau : public Zeichnung
{
private:
    Schrift *schrift;
    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;
    int ref;

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

#endif