Map.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. #ifndef Map_H
  2. #define Map_H
  3. #include <Bild.h>
  4. #include "Spieler.h"
  5. #include <Random.h>
  6. #include "KSGNetwork.h"
  7. using namespace Framework;
  8. class Map
  9. {
  10. public:
  11. struct Save
  12. {
  13. int score;
  14. int scoreCheck;
  15. bool beendet;
  16. double gameTime;
  17. RCArray< Spieler > *gegner;
  18. RCArray< Spieler > *ziele;
  19. Spieler *spieler;
  20. };
  21. private:
  22. RCArray< Spieler > *gegner;
  23. RCArray< Spieler > *ziele;
  24. Spieler *spieler;
  25. Rahmen *feld;
  26. Rahmen *kam;
  27. Rahmen *map;
  28. int kamX;
  29. int kamY;
  30. int score;
  31. int scoreCheck;
  32. int breite;
  33. int höhe;
  34. int geschwindigkeit;
  35. int zAnzahl;
  36. int neuGegner;
  37. bool beendet;
  38. double gameTime;
  39. Datei capture;
  40. Critical cs;
  41. KSGClient::MinigameServerClient *klient;
  42. RandomGenerator *rGen;
  43. char tastenStände;
  44. int ref;
  45. public:
  46. // Konstruktor
  47. Map( KSGClient::MinigameServerClient *klient );
  48. // Destruktor
  49. ~Map();
  50. // nicht constant
  51. void reset( Text *zOptionen );
  52. void doPublicMausEreignis( MausEreignis &me );
  53. void doTastaturEreignis( TastaturEreignis &te );
  54. bool tick( double tickVal );
  55. void render( Bild &zRObj );
  56. void speichern();
  57. Save *saveState();
  58. void reloadState( Save *s );
  59. // constant
  60. int getScore() const;
  61. bool istBeendet() const;
  62. bool canGoLeft() const;
  63. bool canGoUp() const;
  64. bool canGoRight() const;
  65. bool canGoDown() const;
  66. int getBestOption( bool *left, bool *up, bool *right, bool *down, int maxSteps );
  67. // Reference Counting
  68. Map *getThis();
  69. Map *release();
  70. };
  71. #endif