SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
PauseHandler.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolHandler.h"
7 #include "AIPauseMessage.h"
8 #include "Server.h"
9 
10 namespace ai {
11 
12 class Server;
13 
15 private:
16  Server& _server;
17 public:
18  explicit PauseHandler(Server& server) : _server(server) {
19  }
20 
21  void execute(const ClientId& clientId, const IProtocolMessage& message) override {
22  const AIPauseMessage& msg = static_cast<const AIPauseMessage&>(message);
23  _server.pause(clientId, msg.isPause());
24  }
25 };
26 
27 }
A protocol message is used for the serialization of the ai states for remote debugging.
Definition: IProtocolMessage.h:60
Message for the remote debugging interface.
Definition: AIPauseMessage.h:20
Interface for the execution of assigned IProtocolMessage.
Definition: IProtocolHandler.h:19
Definition: PauseHandler.h:14
void pause(const ClientId &clientId, bool pause)
Will pause/unpause the execution of the behaviour trees for all watched AI instances.
Definition: ServerImpl.h:464
The server can serialize the state of the AI and broadcast it to all connected clients.
Definition: Server.h:50