#ifndef KSGSKlasse_H #define KSGSKlasse_H #include #include #include #include #include "KSGSFunktion.h" #include "../Include/KSGScript.h" namespace KSGScript { class KSGSKlasse; // aus dieser Datei class KSGSKlasseInstanz : public KSGSVariable { protected: RCArray< KSGSVariable > *lokaleVariablen; RCArray< KSGSFunktion > *funktionen; Array< bool > *varPublic; KSGScriptObj *obj; int typ; int ref; public: // Konstruktor KSGSKlasseInstanz( int typ, Array< KSGSVariableDef* > *zVars, RCArray< KSGSFunktion > *funcs, KSGScriptObj *zObj ); // Destruktor ~KSGSKlasseInstanz(); // nicht constant virtual KSGSVariable *startFunktion( int id, bool zugriff, RCArray< KSGSVariable > *parameter ) override; virtual KSGSVariable *doOperator( int id, KSGSVariable *rechts ) override; virtual void setVariable( int id, KSGSVariable *var ) override; // constant virtual KSGSVariable *getVariable( int id, bool zugriff ) const override; virtual KSGSVariable *umwandelnIn( int typ ) const override; virtual int getTyp() const override; // verarbeiten virtual bool getBool() const override; virtual int getInt() const override; virtual double getDouble() const override; virtual Text *getText() const override; virtual Bild *getBild() const override; virtual MausEreignis getMausEreignis() const override; virtual TastaturEreignis getTastaturEreignis() const override; virtual TextFeld *getTextFeld() const override; virtual Knopf *getKnopf() const override; virtual Fenster *getFenster() const override; virtual BildZ *getBildZ() const override; virtual Animation2DData *getAnimation2DData() const override; virtual Animation2D *getAnimation2D() const override; virtual Zeichnung *getZeichnung() const override; virtual RCArray< KSGSVariable > *getArray() const override; // Reference Counting virtual KSGSVariable *getThis() override; virtual KSGSVariable *release() override; // static static KSGSVariable *erstellVariable( KSGScriptObj *zObj, KSGSVariableDef *def ); }; class KSGSKlasse { private: Array< KSGSVariableDef* > *var; RCArray< KSGSFunktion > *funktionen; int id; int ref; public: // Konstruktor __declspec( dllexport ) KSGSKlasse( int id ); // Destruktor __declspec( dllexport ) ~KSGSKlasse(); // nicht constant __declspec( dllexport ) void addVariable( KSGSVariableDef *var ); __declspec( dllexport ) void addFunktion( KSGSFunktion *func ); __declspec( dllexport ) KSGSKlasseInstanz *erstellInstanz( KSGScriptObj *zObj ); // constant __declspec( dllexport ) int getId() const; // Reference Counting __declspec( dllexport ) KSGSKlasse *getThis(); __declspec( dllexport ) KSGSKlasse *release(); }; } #endif