clientwrapper.h 463 B

123456789101112131415161718192021
  1. #ifndef CLIENTWRAPPER_H
  2. #define CLIENTWRAPPER_H
  3. #include <QObject>
  4. #include "snakesimulatorclient.h"
  5. class ClientWrapper : public QObject
  6. {
  7. Q_OBJECT
  8. public:
  9. ClientWrapper(snakesimulator::SnakeSimulatorClient* client) :
  10. m_client(client){}
  11. Q_INVOKABLE void setSpeed(int speed) {
  12. m_client->setSpeed({(QtProtobuf::uint32)speed, nullptr});
  13. }
  14. private:
  15. snakesimulator::SnakeSimulatorClient* m_client;
  16. };
  17. #endif // CLIENTWRAPPER_H