SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
ChangeHandler.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolHandler.h"
7 #include "Server.h"
8 #include "AIChangeMessage.h"
9 
10 namespace ai {
11 
12 class Server;
13 
15 private:
16  Server& _server;
17 public:
18  explicit ChangeHandler(Server& server) : _server(server) {
19  }
20 
21  void execute(const ClientId& /*clientId*/, const IProtocolMessage& message) override{
22  const AIChangeMessage& msg = static_cast<const AIChangeMessage&>(message);
23  _server.setDebug(msg.getName());
24  }
25 };
26 
27 }
A protocol message is used for the serialization of the ai states for remote debugging.
Definition: IProtocolMessage.h:60
Definition: ChangeHandler.h:14
Message for the remote debugging interface.
Definition: AIChangeMessage.h:16
Interface for the execution of assigned IProtocolMessage.
Definition: IProtocolHandler.h:19
void setDebug(const std::string &zoneName)
Activate the debugging for this particular zone. And disables the debugging for every other zone...
Definition: ServerImpl.h:439
The server can serialize the state of the AI and broadcast it to all connected clients.
Definition: Server.h:50