diff options
author | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-22 13:35:48 -0800 |
---|---|---|
committer | olpc user <olpc@xo-5d-f7-86.localdomain> | 2019-11-22 13:35:48 -0800 |
commit | 8565b47b9e8a59ac06e4f739d63218b0f1e5cb05 (patch) | |
tree | a6b42986293d5e6f3fa7d624bf783bc65db38cf3 /starts/meaning-vm/concept.cpp | |
parent | 018ced49ce429b123cbf63534d75f16ca91a96c2 (diff) | |
download | standingwithresilience-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.cpp | 15 |
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); |