SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
AIUpdateNodeMessage.h
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "IProtocolMessage.h"
7 #include "AIStubTypes.h"
8 
9 namespace ai {
10 
17 private:
18  int32_t _nodeId;
19  CharacterId _characterId;
20  std::string _name;
21  std::string _type;
22  std::string _condition;
23 
24 public:
25  AIUpdateNodeMessage(int32_t nodeId, CharacterId characterId, const std::string& name, const std::string& type,
26  const std::string& condition) :
27  IProtocolMessage(PROTO_UPDATENODE), _nodeId(nodeId), _characterId(characterId), _name(name), _type(type), _condition(condition) {
28  }
29 
30  explicit AIUpdateNodeMessage(streamContainer& in) :
31  IProtocolMessage(PROTO_UPDATENODE) {
32  _nodeId = readInt(in);
33  _characterId = readInt(in);
34  _name = readString(in);
35  _type = readString(in);
36  _condition = readString(in);
37  }
38 
39  void serialize(streamContainer& out) const override {
40  addByte(out, _id);
41  addInt(out, _nodeId);
42  addInt(out, _characterId);
43  addString(out, _name);
44  addString(out, _type);
45  addString(out, _condition);
46  }
47 
48  inline const std::string& getName() const {
49  return _name;
50  }
51 
52  inline const std::string& getType() const {
53  return _type;
54  }
55 
56  inline const std::string& getCondition() const {
57  return _condition;
58  }
59 
60  inline uint32_t getNodeId() const {
61  return _nodeId;
62  }
63 
64  inline CharacterId getCharacterId() const {
65  return _characterId;
66  }
67 };
68 
69 }
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: AIUpdateNodeMessage.h:16