Spiel.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef Spiel_H
  2. #define Spiel_H
  3. #include "SpielKlasse.h"
  4. #include <Array.h>
  5. #ifdef WIN32
  6. #include "..\Strukturen.h"
  7. #include "Statistik\Statistik.h"
  8. #else
  9. #include "Strukturen.h"
  10. #include "Statistik.h"
  11. #define HINSTANCE void*
  12. #endif
  13. class SSKlient; // SpielServer.h
  14. class SpielServer; // SpielServer.h
  15. using namespace Framework;
  16. using namespace Network;
  17. class Spiel : public Thread
  18. {
  19. private:
  20. SpielServer *ss;
  21. int id;
  22. RCArray< SSKlient > *klients;
  23. SpielerTeamStruktur *sts;
  24. Array< int > *accounts;
  25. Array< int > *spielerNummern;
  26. Array< int > *status;
  27. Array< int > *prozent;
  28. Array< bool > *teamAuswahlFertig;
  29. SpielKlasse *spiel;
  30. StatistikV *statistik;
  31. int state;
  32. int spielerAnzahl;
  33. int karte;
  34. HINSTANCE spielDll;
  35. int findFreeTeam();
  36. void teamAusgleich();
  37. public:
  38. // Konstruktor
  39. Spiel( int id, SpielServer *ss );
  40. // Destruktor
  41. virtual ~Spiel();
  42. // nicht constant
  43. void setAccounts( int anzahl, Array< int > *zAccounts );
  44. void setKlients( int anzahl, RCArray< SSKlient > *zKlients );
  45. void setKarteId( int karteId );
  46. bool klientVerbunden( SSKlient *klient );
  47. bool klientWechseltTeam( int accountId, int team );
  48. bool chatNachricht( char *nachricht );
  49. bool klientGetrennt( SSKlient *zKlient );
  50. bool klientTeamAuswahlFertig( int accountId );
  51. bool klientBereitZumLaden( int accountId );
  52. bool klientSpielLadenProzent( int accountId, int prozent );
  53. bool klientBereitZumSpiel( int accountId );
  54. bool spielNachricht( int accountId, int len, char *bytes );
  55. bool statistikNachricht( int accountId, int len, char *bytes );
  56. virtual void thread();
  57. // constant
  58. int getId() const;
  59. int getSpielerNummer( int accountId ) const;
  60. };
  61. #endif