| 93 | } |
| 94 | |
| 95 | bool AccessBehaviorKnowledge(BehaviorKnowledge* knowledge, const StringAnsiView& path, Variant& value, bool set) |
| 96 | { |
| 97 | const int32 typeEnd = path.Find('/'); |
| 98 | if (typeEnd == -1) |
| 99 | return false; |
| 100 | const StringAnsiView type(path.Get(), typeEnd); |
| 101 | if (type == "Blackboard") |
| 102 | { |
| 103 | const StringAnsiView member(path.Get() + typeEnd + 1, path.Length() - typeEnd - 1); |
| 104 | return AccessVariant(knowledge->Blackboard, member, value, set); |
| 105 | } |
| 106 | if (type == "Goal") |
| 107 | { |
| 108 | const StringAnsiView subPath(path.Get() + typeEnd + 1, path.Length() - typeEnd - 1); |
| 109 | const int32 goalTypeEnd = subPath.Find('/'); |
| 110 | const StringAnsiView goalType(subPath.Get(), goalTypeEnd); |
| 111 | const StringAnsiView member(subPath.Get() + goalTypeEnd + 1, subPath.Length() - goalTypeEnd - 1); |
| 112 | for (Variant& goal : knowledge->Goals) |
| 113 | { |
| 114 | if (goalType == goal.Type.GetTypeName()) |
| 115 | { |
| 116 | return AccessVariant(goal, member, value, set); |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | return false; |
| 121 | } |
| 122 | |
| 123 | bool BehaviorKnowledgeSelectorAny::Set(BehaviorKnowledge* knowledge, const Variant& value) const |
| 124 | { |
no test coverage detected