Schalter.cpp 521 B

1234567891011121314151617181920212223242526272829303132333435
  1. #include "Schalter.h"
  2. Schalter::Schalter( int id, int x, int y, int width, int height, bool aktive )
  3. : GameObject( SCHALTER, x, y, width, height )
  4. {
  5. this->id = id;
  6. this->aktiv = aktive;
  7. aktivierungen = 0;
  8. }
  9. void Schalter::setAktive( bool aktiv )
  10. {
  11. this->aktiv = aktiv;
  12. }
  13. void Schalter::press()
  14. {
  15. aktivierungen++;
  16. }
  17. int Schalter::getAnzahlAktivierungen() const
  18. {
  19. return aktivierungen;
  20. }
  21. bool Schalter::isAktive() const
  22. {
  23. return aktiv;
  24. }
  25. int Schalter::getId() const
  26. {
  27. return id;
  28. }