Timer.h 890 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #include "GameObject.h"
  3. class Spiel;
  4. class Timer : public GameObject
  5. {
  6. private:
  7. static int nextId;
  8. int id;
  9. Text name;
  10. bool runns;
  11. bool pause;
  12. int farbe;
  13. int maxZeit;
  14. float currentTime;
  15. bool autoWiederhohlung;
  16. bool sichtbar;
  17. public:
  18. Timer( const char *name, int maxZeit, int x, int y, bool visible = 1, bool autoWiederhohlung = 0, bool runns = 0, int farbe = 0xFFFFFFFF );
  19. void start( bool restart = 0 );
  20. void setPause( bool pause );
  21. void setMaxZeit( int sekunden );
  22. void setAutoWiederhohlung( bool wiederhohlung );
  23. void setSichtbar( bool visible );
  24. void setFarbe( int farbe );
  25. void tick( double time, Spiel *zSpiel );
  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. };