mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-12 17:14:52 -07:00
protobuf client->server communication almost working
This commit is contained in:
parent
4eb9dfc5bf
commit
314f17091d
96 changed files with 1633 additions and 860 deletions
29
cockatrice/src/pending_command.h
Normal file
29
cockatrice/src/pending_command.h
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#ifndef PENDING_COMMAND_H
|
||||
#define PENDING_COMMAND_H
|
||||
|
||||
#include "protocol_datastructures.h"
|
||||
#include "pb/commands.pb.h"
|
||||
#include <QVariant>
|
||||
|
||||
class ProtocolResponse;
|
||||
|
||||
class PendingCommand : public QObject {
|
||||
Q_OBJECT
|
||||
signals:
|
||||
void finished(ProtocolResponse *response);
|
||||
void finished(ResponseCode response);
|
||||
private:
|
||||
CommandContainer commandContainer;
|
||||
QVariant extraData;
|
||||
int ticks;
|
||||
public:
|
||||
PendingCommand(const CommandContainer &_commandContainer, QVariant _extraData = QVariant())
|
||||
: commandContainer(_commandContainer), extraData(_extraData), ticks(0) { }
|
||||
CommandContainer &getCommandContainer() { return commandContainer; }
|
||||
void setExtraData(const QVariant &_extraData) { extraData = _extraData; }
|
||||
QVariant getExtraData() const { return extraData; }
|
||||
void processResponse(ProtocolResponse *response);
|
||||
int tick() { return ++ticks; }
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue