@inglorious/engine 9.0.0 → 10.0.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/package.json +3 -3
- package/src/core/engine.js +7 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inglorious/engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "A JavaScript game engine written with global state, immutability, and pure functions in mind. Have fun(ctional programming) with it!",
|
|
5
5
|
"author": "IceOnFire <antony.mistretta@gmail.com> (https://ingloriouscoderz.it)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@inglorious/store": "6.
|
|
33
|
+
"@inglorious/store": "6.1.0",
|
|
34
34
|
"@inglorious/utils": "3.6.2"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@inglorious/store": "6.
|
|
37
|
+
"@inglorious/store": "6.1.0",
|
|
38
38
|
"@inglorious/utils": "3.6.2"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
package/src/core/engine.js
CHANGED
|
@@ -2,11 +2,7 @@ import { audio } from "@inglorious/engine/behaviors/audio.js"
|
|
|
2
2
|
import { game } from "@inglorious/engine/behaviors/game.js"
|
|
3
3
|
import { images } from "@inglorious/engine/behaviors/images.js"
|
|
4
4
|
import { createApi } from "@inglorious/store/api.js"
|
|
5
|
-
import {
|
|
6
|
-
connectDevTools,
|
|
7
|
-
disconnectDevTools,
|
|
8
|
-
sendAction,
|
|
9
|
-
} from "@inglorious/store/client/dev-tools.js"
|
|
5
|
+
import { createDevtools } from "@inglorious/store/client/devtools.js"
|
|
10
6
|
import { multiplayerMiddleware } from "@inglorious/store/client/multiplayer-middleware.js"
|
|
11
7
|
import { createStore } from "@inglorious/store/store.js"
|
|
12
8
|
import { augmentType } from "@inglorious/store/types.js"
|
|
@@ -65,15 +61,16 @@ export class Engine {
|
|
|
65
61
|
const multiplayer = this._config.entities.game?.multiplayer
|
|
66
62
|
if (multiplayer) {
|
|
67
63
|
middlewares.push(
|
|
68
|
-
multiplayerMiddleware({ ...multiplayer,
|
|
64
|
+
multiplayerMiddleware({ ...multiplayer, blacklist: coreEvents }),
|
|
69
65
|
)
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
this._store = createStore({ ...this._config, middlewares, mode: "batched" })
|
|
73
69
|
this._loop = new Loop[this._config.loop.type]()
|
|
74
70
|
|
|
71
|
+
this._devtools = createDevtools({ blacklist: coreEvents, mode: "batched" })
|
|
75
72
|
if (this._devMode) {
|
|
76
|
-
|
|
73
|
+
this._devtools.connect(this._store)
|
|
77
74
|
}
|
|
78
75
|
}
|
|
79
76
|
|
|
@@ -118,9 +115,9 @@ export class Engine {
|
|
|
118
115
|
const newDevMode = entities.game?.devMode
|
|
119
116
|
if (newDevMode !== this._devMode) {
|
|
120
117
|
if (newDevMode) {
|
|
121
|
-
|
|
118
|
+
this._devtools.connect(this._store)
|
|
122
119
|
} else {
|
|
123
|
-
|
|
120
|
+
this._devtools.disconnect()
|
|
124
121
|
}
|
|
125
122
|
this._devMode = newDevMode
|
|
126
123
|
}
|
|
@@ -134,7 +131,7 @@ export class Engine {
|
|
|
134
131
|
type: eventsToLog.map(({ type }) => type).join("|"),
|
|
135
132
|
payload: eventsToLog,
|
|
136
133
|
}
|
|
137
|
-
|
|
134
|
+
this._devtools.send(action, entities)
|
|
138
135
|
}
|
|
139
136
|
}
|
|
140
137
|
}
|