ekms 9.1.0 → 9.1.1-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/articles.js +2 -0
- package/common/avatar.js +0 -6
- package/common/colors.instance.json +28 -0
- package/common/comparable.js +6 -0
- package/common/crew.instance.json +0 -39
- package/common/crew.js +0 -7
- package/common/edible.instance.json +56 -0
- package/common/fastfood.instance.json +61 -337
- package/common/menus.instance.json +2 -0
- package/common/menus.js +61 -0
- package/common/menus.test.json +2 -0
- package/common/negation.js +5 -0
- package/common/pipboy.instance.json +84 -122
- package/common/pipboy.js +0 -7
- package/common/properties.js +1 -0
- package/common/reports.instance.json +1 -1
- package/common/temperature.instance.json +112 -0
- package/common/wp.instance.json +56 -0
- package/main.js +2 -0
- package/package.json +7 -3
package/common/menus.js
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
const { knowledgeModule, where, Digraph } = require('./runtime').theprogrammablemind
|
2
|
+
const { defaultContextCheck } = require('./helpers')
|
3
|
+
const ui = require('./ui')
|
4
|
+
const menus_tests = require('./menus.test.json')
|
5
|
+
const menus_instance = require('./menus.instance.json')
|
6
|
+
|
7
|
+
class API {
|
8
|
+
initialize({ objects }) {
|
9
|
+
this._objects = objects
|
10
|
+
}
|
11
|
+
|
12
|
+
move(direction, steps = 1, units = undefined) {
|
13
|
+
this._objects.move = { direction, steps, units }
|
14
|
+
}
|
15
|
+
|
16
|
+
select(item) {
|
17
|
+
this._objects.select = { item }
|
18
|
+
}
|
19
|
+
|
20
|
+
unselect(item) {
|
21
|
+
this._objects.unselect = { item }
|
22
|
+
}
|
23
|
+
|
24
|
+
cancel(direction) {
|
25
|
+
this._objects.cancel = true
|
26
|
+
}
|
27
|
+
|
28
|
+
stop(action) {
|
29
|
+
this._objects.stop = action
|
30
|
+
}
|
31
|
+
}
|
32
|
+
|
33
|
+
const config = {
|
34
|
+
name: 'menus',
|
35
|
+
};
|
36
|
+
|
37
|
+
const template = {
|
38
|
+
fragments: [
|
39
|
+
],
|
40
|
+
}
|
41
|
+
|
42
|
+
knowledgeModule({
|
43
|
+
config,
|
44
|
+
includes: [ui],
|
45
|
+
api: () => new API(),
|
46
|
+
|
47
|
+
module,
|
48
|
+
description: 'Control menues with speech',
|
49
|
+
test: {
|
50
|
+
name: './menus.test.json',
|
51
|
+
contents: menus_tests,
|
52
|
+
checks: {
|
53
|
+
objects: ['move', 'select', 'unselect', 'cancel', 'stop'],
|
54
|
+
context: defaultContextCheck(['operator', 'direction', 'moveable']),
|
55
|
+
},
|
56
|
+
},
|
57
|
+
template: {
|
58
|
+
template,
|
59
|
+
instance: menus_instance
|
60
|
+
}
|
61
|
+
})
|