Spieler.h 716 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef Spieler_H
  2. #define Spieler_H
  3. #include <Bild.h>
  4. #include <Datei.h>
  5. using namespace Framework;
  6. enum SpielerTyp
  7. {
  8. SPIELER,
  9. ZIEL,
  10. GEGNER
  11. };
  12. class Spieler
  13. {
  14. private:
  15. double xPos;
  16. double yPos;
  17. double xSpeed;
  18. double ySpeed;
  19. double durchlässig;
  20. int farbe;
  21. int ref;
  22. public:
  23. // Konstruktor
  24. Spieler( SpielerTyp typ, int mapBr, int mapHö );
  25. Spieler( SpielerTyp typ, Datei *zD );
  26. // Destruktor
  27. ~Spieler();
  28. // nicht constant
  29. void tick( double z, int mapBr, int mapHö );
  30. void render( Bild &zRObj );
  31. // constant
  32. bool berührt( double px, double py ) const;
  33. int getX() const;
  34. int getY() const;
  35. void save( Datei *zD ) const;
  36. // Reference Counting
  37. Spieler *getThis();
  38. Spieler *release();
  39. };
  40. #endif