Refactored in a way modules have access to bot infrastructure
This commit is contained in:
parent
c605b3ba93
commit
89c04254b8
25 changed files with 245 additions and 216 deletions
|
@ -7,9 +7,9 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "gloox/client.h"
|
||||
|
||||
#include "component/core.h"
|
||||
#include "component/actor.h"
|
||||
#include "connection/connection.h"
|
||||
|
||||
namespace Module {
|
||||
|
||||
|
@ -18,8 +18,7 @@ public:
|
|||
typedef std::vector<std::string> Tokens;
|
||||
|
||||
protected:
|
||||
Module(const std::shared_ptr<gloox::Client>& client);
|
||||
void sendMessage(const std::shared_ptr<Actor>& actor, const std::string& body);
|
||||
Module(const std::shared_ptr<Core>& core, const std::shared_ptr<Connection>& connection);
|
||||
|
||||
public:
|
||||
virtual ~Module() noexcept;
|
||||
|
@ -29,7 +28,8 @@ public:
|
|||
virtual void message(const std::shared_ptr<Actor>& actor, const Tokens& args) = 0;
|
||||
|
||||
protected:
|
||||
std::shared_ptr<gloox::Client> client;
|
||||
std::shared_ptr<Core> core;
|
||||
std::shared_ptr<Connection> connection;
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue