#pragma once

#include "Array.h"

namespace Framework
{
    class Bild;
    class Animation2DData;

    class Textur2D
    {
    private:
        struct Animation
        {
            Animation2DData *data;
            int jetzt;
            double ausgleich;
        };
        bool circularAnimation;
        int animationIndex;
        Bild *txt;
        Array< Animation* > *animData;
        int ref;

    public:
        // Konstructor
        __declspec( dllexport ) Textur2D();
        // Destructor
        __declspec( dllexport ) ~Textur2D();
        // Legt fest, ob die animation sich automatisch wiederhohlen soll
        //  ca: 1, falls sich die animation automatisch wiederhohlen soll
        __declspec( dllexport ) void setCircularAnimation( bool ca );
        // setzt einen Zeiger auf die Textur (fals nicht animiert)
        //  textur: Der Zeiger auf das Bild
        __declspec( dllexport ) void setTexturZ( Bild *textur );
        // f�gt eine Animation hinzu
        //  textur: Der Zeiger auf die Animationsdaten
        __declspec( dllexport ) void addAnimationZ( Animation2DData *textur );
        // setzt die aktuelle Annimation
        //  index: Der Index der Animation
        __declspec( dllexport ) void setAnimation( int index );
        // aktiviert die nachfolgende animation
        __declspec( dllexport ) void nextAnimation();
        // setzt die vergangene Zeit seit dem letzten Aufruf
        //  t: die vergangene Zeit in sekunden
        __declspec( dllexport ) bool tick( double t );
        // gibt die aktuelle Textur zur�ck
        __declspec( dllexport ) Bild *zTextur() const;
        // erh�ht den Reference Counter um 1 und gibt this zur�ck
        __declspec( dllexport ) Textur2D *getThis();
        // verringert den reference counter um 1 und l�scht sich selbst, falls er 0 erreicht
        //  gibt 0 zur�ck
        __declspec( dllexport ) Textur2D *release();
    };
}