summaryrefslogtreecommitdiff
path: root/starts/meaning-vm/concept.cpp
diff options
context:
space:
mode:
authorolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-22 13:35:48 -0800
committerolpc user <olpc@xo-5d-f7-86.localdomain>2019-11-22 13:35:48 -0800
commit8565b47b9e8a59ac06e4f739d63218b0f1e5cb05 (patch)
treea6b42986293d5e6f3fa7d624bf783bc65db38cf3 /starts/meaning-vm/concept.cpp
parent018ced49ce429b123cbf63534d75f16ca91a96c2 (diff)
downloadstandingwithresilience-8565b47b9e8a59ac06e4f739d63218b0f1e5cb05.tar.gz
standingwithresilience-8565b47b9e8a59ac06e4f739d63218b0f1e5cb05.zip
basic habit state change meaning boilerplate
Diffstat (limited to 'starts/meaning-vm/concept.cpp')
-rw-r--r--starts/meaning-vm/concept.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/starts/meaning-vm/concept.cpp b/starts/meaning-vm/concept.cpp
index dc9ecca..58d1a7c 100644
--- a/starts/meaning-vm/concept.cpp
+++ b/starts/meaning-vm/concept.cpp
@@ -5,6 +5,21 @@ ref concept::id()
return this;
}
+bool concept::linked(ref type)
+{
+ return links.count(type) > 0;
+}
+
+bool concept::linked(ref type, ref target)
+{
+ for (ref t : getAll(type)) {
+ if (t == target) {
+ return true;
+ }
+ }
+ return false;
+}
+
ref concept::get(ref type)
{
auto result = links.equal_range(type);