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