cm-engine-runner 1.1.2 → 1.1.4
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cm-engine-runner",
|
|
3
3
|
"description": "Abstraction layer to run chess engines, supports opening books",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"scripts": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"homepage": "https://github.com/shaack/cm-chess-engine-adapter#readme",
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"teevi": "^2.2.
|
|
28
|
+
"teevi": "^2.2.4"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"cm-polyglot": "^1.0.7",
|
|
@@ -21,7 +21,11 @@ export class EngineRunner {
|
|
|
21
21
|
}
|
|
22
22
|
Object.assign(this.props, props)
|
|
23
23
|
this.engineState = ENGINE_STATE.LOADING
|
|
24
|
-
this.
|
|
24
|
+
this.initialized = this.init()
|
|
25
|
+
/**
|
|
26
|
+
* @deprecated 2023-04-11 use `this.initialized` instead
|
|
27
|
+
*/
|
|
28
|
+
this.initialization = this.initialized
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
init() {
|
|
@@ -32,4 +36,4 @@ export class EngineRunner {
|
|
|
32
36
|
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
}
|
|
39
|
+
}
|
|
@@ -44,11 +44,11 @@ export class PolyglotRunner extends EngineRunner {
|
|
|
44
44
|
resolve(propabilityMatrix[luckyIndex])
|
|
45
45
|
})
|
|
46
46
|
return new Promise((resolve) => {
|
|
47
|
-
Promise.all([this.
|
|
47
|
+
Promise.all([this.initialized, timeoutPromise, calculationPromise]).then((values) => {
|
|
48
48
|
this.engineState = ENGINE_STATE.READY
|
|
49
49
|
resolve(values[2])
|
|
50
50
|
})
|
|
51
51
|
})
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
}
|
|
54
|
+
}
|