SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
SelectHandler.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolHandler.h"
7 #include "AISelectMessage.h"
8 #include "Server.h"
9 
10 namespace ai {
11 
13 private:
14  Server& _server;
15 public:
16  explicit SelectHandler(Server& server) : _server(server) {
17  }
18 
19  void execute(const ClientId& clientId, const IProtocolMessage& message) override {
20  const AISelectMessage& msg = static_cast<const AISelectMessage&>(message);
21  _server.select(clientId, msg.getCharacterId());
22  }
23 };
24 
25 }
Definition: SelectHandler.h:12
A protocol message is used for the serialization of the ai states for remote debugging.
Definition: IProtocolMessage.h:60
void select(const ClientId &clientId, const CharacterId &id)
Select a particular character (resp. AI instance) and send detail information to all the connected cl...
Definition: ServerImpl.h:457
Interface for the execution of assigned IProtocolMessage.
Definition: IProtocolHandler.h:19
Message for the remote debugging interface.
Definition: AISelectMessage.h:16
The server can serialize the state of the AI and broadcast it to all connected clients.
Definition: Server.h:50