SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
StepHandler.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolHandler.h"
7 #include "Server.h"
8 #include "AIStepMessage.h"
9 
10 namespace ai {
11 
12 class Server;
13 
15 private:
16  Server& _server;
17 public:
18  explicit StepHandler(Server& server) : _server(server) {
19  }
20 
21  void execute(const ClientId& /*clientId*/, const IProtocolMessage& message) override {
22  const AIStepMessage& msg = static_cast<const AIStepMessage&>(message);
23  _server.step(msg.getStepMillis());
24  }
25 };
26 
27 }
A protocol message is used for the serialization of the ai states for remote debugging.
Definition: IProtocolMessage.h:60
Definition: StepHandler.h:14
Interface for the execution of assigned IProtocolMessage.
Definition: IProtocolHandler.h:19
Perform one step if the ai controlled entities are in paused mode.
Definition: AIStepMessage.h:15
The server can serialize the state of the AI and broadcast it to all connected clients.
Definition: Server.h:50
void step(int64_t stepMillis=1L)
Performs one step of the AI in pause mode.
Definition: ServerImpl.h:471