Bariere.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #include "GameObject.h"
  3. #include "Team.h"
  4. #include "Timer.h"
  5. class Bariere : public GameObject
  6. {
  7. public:
  8. class Style
  9. {
  10. public:
  11. const static int AutoSchaltung = 0x1;
  12. const static int AutoVerschiebung = 0x2;
  13. const static int InSchaltung = 0x4;
  14. const static int InVerschiebung = 0x8;
  15. const static int VerschiebungWaagerecht = 0x10;
  16. const static int NextVerschiebungLinksOben = 0x20;
  17. const static int Aktiv = 0x40;
  18. };
  19. private:
  20. static int nextId;
  21. int style;
  22. int autoSchaltungMaxTime;
  23. float autoSchaltungCurrentTime;
  24. int verschiebungWeite;
  25. float currentWeite;
  26. int verschiebungAnzahl;
  27. int schaltungAnzahl;
  28. int id;
  29. Team *team;
  30. public:
  31. Bariere( int x, int y, int breite, int height, int style, int verschiebungWeite = 0, int autoSchaltungMaxTime = 0, Team *team = 0 );
  32. ~Bariere();
  33. void setStyle( int style, bool add );
  34. void setAutoVerschiebungWeite( int pixel );
  35. void startAutoVerschiebung();
  36. void setAutoSchaltungMaxTime( int seconds );
  37. void startAutoSchaltung();
  38. void setTeam( Team *team );
  39. void tick( double time );
  40. bool hatStyle( int style ) const;
  41. int getVerschiebungAnzahl() const;
  42. int getSchaltungAnzahl() const;
  43. Team *getTeam() const;
  44. Team *zTeam() const;
  45. };