-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbot.h
39 lines (29 loc) · 825 Bytes
/
bot.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef BOT_H
#define BOT_H
#include <QtCore>
#include <QThread>
#include "ClientSession.h"
class Bot : public QThread
{
Q_OBJECT
public:
Bot(quint16 id);
~Bot();
quint16 GetId() const { return m_id; }
void SetStarted(bool started) { m_started = started; }
bool IsStarted() { return m_started; }
void SetRunning(bool running) { m_running = running; }
bool IsRunning() { return m_running; }
void Log(QString line) { emit LogSignal(QString("[Bot " + QString::number(GetId()) + "] : ") + line); }
void run();
signals:
void ThreadStarted(quint16 id, qint32 threadId);
void ThreadStopped(quint16 id, qint32 threadId);
void LogSignal(QString line);
private:
quint16 m_id;
bool m_started;
bool m_running;
ClientSession* m_session;
};
#endif // BOT_H