21 id(_id), aggro(_aggro) {
32 std::vector<AIStateAggroEntry> _aggro;
34 inline void reserve(std::size_t size) {
40 _aggro.push_back(entry);
43 inline const std::vector<AIStateAggroEntry>& getAggro()
const {
53 std::string _parameters;
54 std::string _conditionType;
55 std::string _conditionParameters;
57 AIStateNodeStatic(
const int32_t
id,
const std::string& name,
const std::string& type,
const std::string& parameters,
const std::string& conditionType,
const std::string& conditionParameters) :
58 _id(
id), _name(name), _type(type), _parameters(parameters), _conditionType(conditionType), _conditionParameters(conditionParameters) {
65 inline int32_t getId()
const {
69 inline const std::string& getName()
const {
73 inline const std::string& getType()
const {
88 return _conditionParameters;
91 inline std::string getCondition()
const {
92 return _conditionType +
"(" + _conditionParameters +
")";
99 return _conditionType;
109 std::string _condition;
110 typedef std::vector<AIStateNode> NodeVector;
111 NodeVector _children;
113 TreeNodeStatus _status;
114 bool _currentlyRunning;
116 AIStateNode(int32_t
id,
const std::string& condition, int64_t lastRun, TreeNodeStatus status,
bool currentlyRunning) :
117 _nodeId(
id), _condition(condition), _lastRun(lastRun), _status(status), _currentlyRunning(currentlyRunning) {
121 _nodeId(-1), _lastRun(-1L), _status(UNKNOWN), _currentlyRunning(
false) {
125 _children.push_back(child);
129 _children.push_back(std::move(child));
132 inline const std::vector<AIStateNode>& getChildren()
const {
136 inline std::vector<AIStateNode>& getChildren() {
140 inline int32_t getNodeId()
const {
144 inline const std::string& getCondition()
const {
167 return _currentlyRunning;
179 CharacterAttributes _attributes;
181 AIStateWorld() : _id(-1), _position(0.0f, 0.0f, 0.0f), _orientation(0.0f) {}
183 AIStateWorld(
const ai::CharacterId&
id,
const glm::vec3& position,
float orientation,
const CharacterAttributes& attributes) :
184 _id(
id), _position(position), _orientation(orientation), _attributes(attributes) {
187 AIStateWorld(
const ai::CharacterId&
id,
const glm::vec3& position,
float orientation, CharacterAttributes&& attributes) :
188 _id(
id), _position(position), _orientation(orientation), _attributes(std::move(attributes)) {
191 AIStateWorld(
const ai::CharacterId&
id,
const glm::vec3& position,
float orientation) :
192 _id(
id), _position(position), _orientation(orientation) {
195 inline bool operator==(
const AIStateWorld &other)
const {
196 return _id == other._id;
199 inline bool operator<(
const AIStateWorld &other)
const {
200 return _id < other._id;
206 inline const ai::CharacterId&
getId()
const {
bool isRunning() const
Some nodes have a state that holds which children is currently running.
Definition: AIStubTypes.h:166
const std::string & getConditionParameters() const
Returns the raw condition parameters.
Definition: AIStubTypes.h:87
TreeNodeStatus getStatus() const
Definition: AIStubTypes.h:158
float getOrientation() const
Definition: AIStubTypes.h:215
This is a representation of a character state for the serialization.
Definition: AIStubTypes.h:174
CharacterAttributes & getAttributes()
Definition: AIStubTypes.h:236
int64_t getLastRun() const
Definition: AIStubTypes.h:151
The list of aggro entry for a character.
Definition: AIStubTypes.h:30
const std::string & getConditionType() const
Returns the raw condition type string.
Definition: AIStubTypes.h:98
Definition: AIStubTypes.h:48
const ai::CharacterId & getId() const
Definition: AIStubTypes.h:206
The aggro entry for the AIStateAggro.
Definition: AIStubTypes.h:19
This is a representation of a behaviour tree node for the serialization.
Definition: AIStubTypes.h:106
const CharacterAttributes & getAttributes() const
Definition: AIStubTypes.h:229
const glm::vec3 & getPosition() const
Definition: AIStubTypes.h:222
const std::string & getParameters() const
Returns the raw parameters for the task node.
Definition: AIStubTypes.h:80