#pragma once #include "GameObject.h" class Spiel; class Timer : public GameObject { private: int id; Text name; bool runns; bool pause; int farbe; int maxZeit; float currentTime; bool autoWiederhohlung; bool sichtbar; public: Timer( int id, const char *name, int maxZeit, int x, int y, bool visible = 1, bool autoWiederhohlung = 0, bool runns = 0, int farbe = 0xFFFFFFFF ); void start( Spiel *zSpiel, bool restart = 0 ); void setPause( Spiel *zSpiel, bool pause ); void setMaxZeit( int sekunden ); void setAutoWiederhohlung( bool wiederhohlung ); void setSichtbar( bool visible ); void setFarbe( int farbe ); void tick( double time, Spiel *zSpiel ); void setZeit( float zeit ); float getTimeLeft() const; bool istSichtbar() const; int getFarbe() const; bool isRunning() const; bool istPausiert() const; int getMaxTime() const; bool istAutoWiederhohlung() const; int getId() const; };