File tree Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Expand file tree Collapse file tree 2 files changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ namespace Langulus::A
36
36
struct Mind : virtual AIUnit {
37
37
LANGULUS_BASES (AIUnit);
38
38
Mind () : Resolvable {this } {}
39
+
40
+ virtual Many Interpret (const Langulus::Text&) = 0;
39
41
};
40
42
41
43
} // namespace Langulus::A
Original file line number Diff line number Diff line change 8
8
#include " Thing.hpp"
9
9
#include " Thing.inl"
10
10
#include < Flow/Verbs/Conjunct.hpp>
11
+ #include < Langulus/AI.hpp>
11
12
12
13
13
14
namespace Langulus ::Entity
@@ -21,14 +22,29 @@ namespace Langulus::Entity
21
22
if (not text)
22
23
return {};
23
24
24
- // Push and execute in the active flow
25
+ // Get minds from the current context
26
+ auto minds = GatherUnits<A::Mind, Seek::HereAndAbove>();
27
+ if (not minds) {
28
+ Logger::Error (this , " : No minds - can't interpret message: " , text);
29
+ return {};
30
+ }
31
+
32
+ // Get a flow for executing the interpreted messages
25
33
auto flow = GetFlow ();
26
34
if (not flow) {
27
35
Logger::Error (this , " : No flow - can't execute message: " , text);
28
36
return {};
29
37
}
30
38
31
- return flow->Push (Verbs::Do::In (this , text));
39
+ // Interpret by each mind and then execute in flow
40
+ Many results;
41
+ for (auto & mind : minds) {
42
+ auto interpretation = mind->Interpret (text);
43
+ if (interpretation)
44
+ results << flow->Push (interpretation);
45
+ }
46
+
47
+ return Abandon (results);
32
48
}
33
49
34
50
// / Executes a piece of code in the current context
You can’t perform that action at this time.
0 commit comments