14 const std::vector<AIStateNodeStatic>* _nodeStaticDataPtr;
15 std::vector<AIStateNodeStatic> _nodeStaticData;
22 IProtocolMessage(PROTO_CHARACTER_STATIC), _chrId(id), _nodeStaticDataPtr(&nodeStaticData) {
28 const std::size_t size = readInt(in);
29 _nodeStaticData.reserve(size);
30 for (std::size_t i = 0; i < size; ++i) {
31 const int32_t
id = readInt(in);
32 const std::string& name = readString(in);
33 const std::string& type = readString(in);
34 const std::string& parameters = readString(in);
35 const std::string& conditionType = readString(in);
36 const std::string& conditionParameters = readString(in);
37 const AIStateNodeStatic staticData(
id, name, type, parameters, conditionType, conditionParameters);
38 _nodeStaticData.push_back(staticData);
42 void serialize(streamContainer& out)
const override {
45 const std::size_t size = _nodeStaticDataPtr->size();
46 addInt(out, static_cast<int>(size));
47 for (std::size_t i = 0; i < size; ++i) {
48 addInt(out, (*_nodeStaticDataPtr)[i].getId());
49 addString(out, (*_nodeStaticDataPtr)[i].getName());
50 addString(out, (*_nodeStaticDataPtr)[i].getType());
51 addString(out, (*_nodeStaticDataPtr)[i].getParameters());
52 addString(out, (*_nodeStaticDataPtr)[i].getConditionType());
53 addString(out, (*_nodeStaticDataPtr)[i].getConditionParameters());
57 inline const std::vector<AIStateNodeStatic>& getStaticNodeData()
const {
58 if (_nodeStaticDataPtr)
59 return *_nodeStaticDataPtr;
60 return _nodeStaticData;
A protocol message is used for the serialization of the ai states for remote debugging.
Definition: IProtocolMessage.h:60
Definition: AICharacterStaticMessage.h:11
AICharacterStaticMessage(const CharacterId &id, const std::vector< AIStateNodeStatic > &nodeStaticData)
Definition: AICharacterStaticMessage.h:21
Definition: AIStubTypes.h:48