SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
AISelectMessage.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolMessage.h"
7 #include "ICharacter.h"
8 
9 namespace ai {
10 
17 private:
18  ai::CharacterId _chrId;
19 
20 public:
21  explicit AISelectMessage(ai::CharacterId id) :
22  IProtocolMessage(PROTO_SELECT) {
23  _chrId = id;
24  }
25 
26  explicit AISelectMessage(streamContainer& in) :
27  IProtocolMessage(PROTO_SELECT) {
28  _chrId = readInt(in);
29  }
30 
31  void serialize(streamContainer& out) const override {
32  addByte(out, _id);
33  addInt(out, _chrId);
34  }
35 
36  inline const CharacterId& getCharacterId() const {
37  return _chrId;
38  }
39 };
40 
41 }
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: AISelectMessage.h:16