CGameHandler.h 589 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "../global.h"
  3. #include <set>
  4. class CVCMIServer;
  5. class CGameState;
  6. class CConnection;
  7. struct StartInfo;
  8. template <typename T> struct CPack;
  9. class CGameHandler
  10. {
  11. CGameState *gs;
  12. CVCMIServer *s;
  13. std::map<int,CConnection*> connections;
  14. std::set<CConnection*> conns;
  15. public:
  16. CGameHandler(void);
  17. ~CGameHandler(void);
  18. void init(StartInfo *si, int Seed);
  19. void handleConnection(std::set<int> players, CConnection &c);
  20. template <typename T>void sendToAllClients(CPack<T> * info);
  21. void run();
  22. void newTurn();
  23. friend class CVCMIServer;
  24. };