123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef CLIENTWRAPPER_H
- #define CLIENTWRAPPER_H
- #include <QObject>
- #include "snakesimulator_grpc.qpb.h"
- class ClientWrapper : public QObject
- {
- Q_OBJECT
- public:
- ClientWrapper(snakesimulator::SnakeSimulatorClient* client) :
- m_client(client){}
- Q_INVOKABLE void setSpeed(int speed) {
- m_client->setSpeed({(QtProtobuf::uint32)speed, nullptr});
- }
- Q_INVOKABLE void playBest() {
- m_client->playBest({nullptr});
- }
- Q_INVOKABLE void playBestInLoop(bool play) {
- m_client->playBestInLoop({play, nullptr});
- }
- private:
- snakesimulator::SnakeSimulatorClient* m_client;
- };
- #endif
|