LobbyWindow.h 896 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * LobbyWindow.h, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #pragma once
  11. #include "../gui/InterfaceObjectConfigurable.h"
  12. #include "../windows/CWindowObject.h"
  13. #include "../../lib/network/NetworkClient.h"
  14. class LobbyWidget : public InterfaceObjectConfigurable
  15. {
  16. public:
  17. LobbyWidget();
  18. };
  19. class LobbyClient : public NetworkClient
  20. {
  21. void onPacketReceived(const std::vector<uint8_t> & message) override;
  22. void onConnectionFailed(const std::string & errorMessage) override;
  23. void onDisconnected() override;
  24. public:
  25. LobbyClient() = default;
  26. };
  27. class LobbyWindow : public CWindowObject
  28. {
  29. std::shared_ptr<LobbyWidget> widget;
  30. std::shared_ptr<LobbyClient> connection;
  31. void tick(uint32_t msPassed);
  32. public:
  33. LobbyWindow();
  34. };