Timer.h 921 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "GameObject.h"
  3. class Spiel;
  4. class Timer : public GameObject
  5. {
  6. private:
  7. int id;
  8. Text name;
  9. bool runns;
  10. bool pause;
  11. int farbe;
  12. int maxZeit;
  13. float currentTime;
  14. bool autoWiederhohlung;
  15. bool sichtbar;
  16. public:
  17. Timer( int id, const char *name, int maxZeit, int x, int y, bool visible = 1, bool autoWiederhohlung = 0, bool runns = 0, int farbe = 0xFFFFFFFF );
  18. void start( Spiel *zSpiel, bool restart = 0 );
  19. void setPause( bool pause );
  20. void setMaxZeit( int sekunden );
  21. void setAutoWiederhohlung( bool wiederhohlung );
  22. void setSichtbar( bool visible );
  23. void setFarbe( int farbe );
  24. void tick( double time, Spiel *zSpiel );
  25. float getTimeLeft() const;
  26. bool istSichtbar() const;
  27. int getFarbe() const;
  28. bool isRunning() const;
  29. bool istPausiert() const;
  30. int getMaxTime() const;
  31. bool istAutoWiederhohlung() const;
  32. };