@benev/tact 0.2.0 → 0.3.0-2

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.
Files changed (495) hide show
  1. package/README.md +48 -390
  2. package/package.json +25 -27
  3. package/s/_archive/README.md +435 -0
  4. package/s/_archive/deck/deck.ts +69 -0
  5. package/s/_archive/demo/main.bundle.ts +10 -0
  6. package/s/_archive/demo/main.css +85 -0
  7. package/s/_archive/index.html.ts +61 -0
  8. package/s/_archive/index.ts +8 -0
  9. package/s/_archive/tests.test.ts +6 -0
  10. package/s/_archive/utils/circular-clamp.ts +14 -0
  11. package/s/_archive/utils/evergreen.ts +10 -0
  12. package/s/_archive/utils/split-axis.ts +15 -0
  13. package/s/assets/b.png +0 -0
  14. package/s/core/atom/defaults.ts +32 -0
  15. package/s/core/atom/lens-algo.ts +84 -0
  16. package/s/core/atom/types.ts +44 -0
  17. package/s/core/bindings/normalize.ts +27 -0
  18. package/s/core/bindings/shape.ts +15 -0
  19. package/s/core/bindings/table.ts +22 -0
  20. package/s/core/intent/bucket.ts +28 -0
  21. package/s/core/intent/consts.ts +4 -0
  22. package/s/core/intent/decode.ts +23 -0
  23. package/s/core/intent/encode.ts +20 -0
  24. package/s/core/intent/merge.ts +15 -0
  25. package/s/core/parts/action.ts +36 -0
  26. package/s/core/parts/sample-map.ts +24 -0
  27. package/s/core/resolvers/actions.ts +30 -0
  28. package/s/core/resolvers/intents.ts +106 -0
  29. package/s/core/types.ts +40 -0
  30. package/s/deck/controller.ts +35 -0
  31. package/s/deck/deck.ts +76 -53
  32. package/s/deck/parts/profiles.ts +39 -0
  33. package/s/deck/parts/runtime.ts +11 -0
  34. package/s/deck/parts/settings.ts +30 -0
  35. package/s/deck/port.ts +35 -0
  36. package/s/deck/types.ts +16 -0
  37. package/s/demo/demo-app/element.ts +17 -0
  38. package/s/demo/demo-app/style.css.ts +10 -0
  39. package/s/demo/main.bundle.ts +67 -6
  40. package/s/demo/main.css +6 -8
  41. package/s/device/devices.ts +24 -0
  42. package/s/device/gamepad.ts +42 -0
  43. package/s/device/keyboard.ts +33 -0
  44. package/s/device/pad/on-pad.ts +50 -0
  45. package/s/device/pad/pad.ts +10 -0
  46. package/s/device/pointer.ts +97 -0
  47. package/s/device/sampler.ts +25 -0
  48. package/s/device/stick.ts +24 -0
  49. package/s/gamepad/gamepad-app/element.ts +65 -0
  50. package/s/gamepad/gamepad-app/style.css.ts +73 -0
  51. package/s/gamepad/index.html.ts +44 -0
  52. package/s/gamepad/main.bundle.ts +6 -0
  53. package/s/gamepad/main.css +60 -0
  54. package/s/index-ui.ts +3 -0
  55. package/s/index.html.ts +10 -17
  56. package/s/index.ts +28 -5
  57. package/s/test.ts +339 -0
  58. package/s/ui/views/desk/style.css.ts +70 -0
  59. package/s/ui/views/desk/view.ts +122 -0
  60. package/s/utils/circular-clamp.ts +2 -2
  61. package/s/utils/do-async.ts +5 -0
  62. package/s/utils/freeze-clone.ts +7 -0
  63. package/s/utils/identifier.ts +30 -0
  64. package/s/utils/insert.ts +6 -0
  65. package/s/utils/is-down.ts +5 -0
  66. package/s/utils/make-id.ts +7 -0
  67. package/s/utils/remap.ts +7 -0
  68. package/s/utils/shift-limit.ts +9 -0
  69. package/s/utils/sort-by-key.ts +7 -0
  70. package/s/utils/tmax.ts +7 -0
  71. package/s/utils/tmin.ts +7 -0
  72. package/x/_archive/demo/main.css +85 -0
  73. package/x/assets/b.png +0 -0
  74. package/x/core/{bindings/parts → atom}/defaults.d.ts +1 -1
  75. package/x/core/atom/defaults.js.map +1 -0
  76. package/x/core/{bindings/parts → atom}/lens-algo.d.ts +1 -1
  77. package/x/core/{bindings/parts → atom}/lens-algo.js +8 -8
  78. package/x/core/atom/lens-algo.js.map +1 -0
  79. package/x/core/{bindings → atom}/types.d.ts +1 -15
  80. package/x/core/{devices → atom}/types.js.map +1 -1
  81. package/x/core/bindings/normalize.d.ts +2 -0
  82. package/x/core/bindings/normalize.js +17 -0
  83. package/x/core/bindings/normalize.js.map +1 -0
  84. package/x/core/bindings/shape.d.ts +2 -0
  85. package/x/core/bindings/shape.js +10 -0
  86. package/x/core/bindings/shape.js.map +1 -0
  87. package/x/core/bindings/table.d.ts +2 -0
  88. package/x/core/bindings/table.js +15 -0
  89. package/x/core/bindings/table.js.map +1 -0
  90. package/x/core/intent/bucket.d.ts +7 -0
  91. package/x/core/intent/bucket.js +21 -0
  92. package/x/core/intent/bucket.js.map +1 -0
  93. package/x/core/intent/consts.d.ts +2 -0
  94. package/x/core/intent/consts.js +3 -0
  95. package/x/core/intent/consts.js.map +1 -0
  96. package/x/core/intent/decode.d.ts +3 -0
  97. package/x/core/intent/decode.js +18 -0
  98. package/x/core/intent/decode.js.map +1 -0
  99. package/x/core/intent/encode.d.ts +3 -0
  100. package/x/core/intent/encode.js +15 -0
  101. package/x/core/intent/encode.js.map +1 -0
  102. package/x/core/intent/merge.d.ts +3 -0
  103. package/x/core/intent/merge.js +10 -0
  104. package/x/core/intent/merge.js.map +1 -0
  105. package/x/core/{bindings → parts}/action.d.ts +5 -3
  106. package/x/core/parts/action.js +30 -0
  107. package/x/core/parts/action.js.map +1 -0
  108. package/x/core/parts/sample-map.d.ts +6 -0
  109. package/x/core/{bindings → parts}/sample-map.js +2 -3
  110. package/x/core/parts/sample-map.js.map +1 -0
  111. package/x/core/resolvers/actions.d.ts +2 -0
  112. package/x/core/resolvers/actions.js +23 -0
  113. package/x/core/resolvers/actions.js.map +1 -0
  114. package/x/core/resolvers/intents.d.ts +2 -0
  115. package/x/core/{bindings/resolver.js → resolvers/intents.js} +39 -43
  116. package/x/core/resolvers/intents.js.map +1 -0
  117. package/x/core/types.d.ts +43 -0
  118. package/x/core/types.js +2 -0
  119. package/x/core/types.js.map +1 -0
  120. package/x/deck/controller.d.ts +11 -0
  121. package/x/deck/controller.js +28 -0
  122. package/x/deck/controller.js.map +1 -0
  123. package/x/deck/deck.d.ts +30 -26
  124. package/x/deck/deck.js +64 -43
  125. package/x/deck/deck.js.map +1 -1
  126. package/x/deck/parts/profiles.d.ts +12 -0
  127. package/x/deck/parts/profiles.js +31 -0
  128. package/x/deck/parts/profiles.js.map +1 -0
  129. package/x/deck/parts/runtime.d.ts +8 -0
  130. package/x/deck/parts/runtime.js +7 -0
  131. package/x/deck/parts/runtime.js.map +1 -0
  132. package/x/deck/parts/settings.d.ts +11 -0
  133. package/x/deck/parts/settings.js +26 -0
  134. package/x/deck/parts/settings.js.map +1 -0
  135. package/x/deck/port.d.ts +10 -0
  136. package/x/deck/port.js +24 -0
  137. package/x/deck/port.js.map +1 -0
  138. package/x/deck/types.d.ts +11 -0
  139. package/x/deck/types.js +2 -0
  140. package/x/deck/types.js.map +1 -0
  141. package/x/demo/demo-app/element.d.ts +3 -0
  142. package/x/demo/demo-app/element.js +13 -0
  143. package/x/demo/demo-app/element.js.map +1 -0
  144. package/x/demo/demo-app/style.css.js +9 -0
  145. package/x/demo/demo-app/style.css.js.map +1 -0
  146. package/x/demo/main.bundle.js +53 -5
  147. package/x/demo/main.bundle.js.map +1 -1
  148. package/x/demo/main.bundle.min.js +106 -395
  149. package/x/demo/main.bundle.min.js.LEGAL.txt +33 -0
  150. package/x/demo/main.bundle.min.js.map +4 -4
  151. package/x/demo/main.css +6 -8
  152. package/x/device/devices.d.ts +7 -0
  153. package/x/device/devices.js +17 -0
  154. package/x/device/devices.js.map +1 -0
  155. package/x/device/gamepad.d.ts +9 -0
  156. package/x/device/gamepad.js +37 -0
  157. package/x/device/gamepad.js.map +1 -0
  158. package/x/{core/devices/standard → device}/keyboard.d.ts +1 -1
  159. package/x/{core/devices/standard → device}/keyboard.js +4 -2
  160. package/x/device/keyboard.js.map +1 -0
  161. package/x/device/pad/on-pad.d.ts +3 -0
  162. package/x/device/pad/on-pad.js +42 -0
  163. package/x/device/pad/on-pad.js.map +1 -0
  164. package/x/device/pad/pad.d.ts +6 -0
  165. package/x/device/pad/pad.js +11 -0
  166. package/x/device/pad/pad.js.map +1 -0
  167. package/x/{core/devices/standard → device}/pointer.d.ts +2 -2
  168. package/x/{core/devices/standard → device}/pointer.js +4 -4
  169. package/x/device/pointer.js.map +1 -0
  170. package/x/device/sampler.d.ts +9 -0
  171. package/x/device/sampler.js +19 -0
  172. package/x/device/sampler.js.map +1 -0
  173. package/x/{core/devices/standard → device}/stick.d.ts +2 -3
  174. package/x/{core/devices/standard → device}/stick.js +4 -6
  175. package/x/device/stick.js.map +1 -0
  176. package/x/gamepad/gamepad-app/element.d.ts +1 -0
  177. package/x/gamepad/gamepad-app/element.js +54 -0
  178. package/x/gamepad/gamepad-app/element.js.map +1 -0
  179. package/x/gamepad/gamepad-app/style.css.js +72 -0
  180. package/x/gamepad/gamepad-app/style.css.js.map +1 -0
  181. package/x/gamepad/index.html +35 -0
  182. package/x/gamepad/index.html.d.ts +2 -0
  183. package/x/gamepad/index.html.js +41 -0
  184. package/x/gamepad/index.html.js.map +1 -0
  185. package/x/gamepad/main.bundle.js +4 -0
  186. package/x/gamepad/main.bundle.js.map +1 -0
  187. package/x/gamepad/main.bundle.min.js +126 -0
  188. package/x/gamepad/main.bundle.min.js.LEGAL.txt +33 -0
  189. package/x/gamepad/main.bundle.min.js.map +7 -0
  190. package/x/gamepad/main.css +60 -0
  191. package/x/index-ui.d.ts +1 -0
  192. package/x/index-ui.js +2 -0
  193. package/x/index-ui.js.map +1 -0
  194. package/x/index.d.ts +27 -5
  195. package/x/index.html +17 -24
  196. package/x/index.html.js +10 -17
  197. package/x/index.html.js.map +1 -1
  198. package/x/index.js +27 -5
  199. package/x/index.js.map +1 -1
  200. package/x/test.d.ts +9 -0
  201. package/x/test.js +307 -0
  202. package/x/test.js.map +1 -0
  203. package/x/ui/views/desk/style.css.js +69 -0
  204. package/x/ui/views/desk/style.css.js.map +1 -0
  205. package/x/ui/views/desk/view.d.ts +7 -0
  206. package/x/ui/views/desk/view.js +102 -0
  207. package/x/ui/views/desk/view.js.map +1 -0
  208. package/x/utils/circular-clamp.js +2 -2
  209. package/x/utils/circular-clamp.js.map +1 -1
  210. package/x/utils/do-async.d.ts +1 -0
  211. package/x/utils/do-async.js +4 -0
  212. package/x/utils/do-async.js.map +1 -0
  213. package/x/utils/freeze-clone.d.ts +1 -0
  214. package/x/utils/freeze-clone.js +5 -0
  215. package/x/utils/freeze-clone.js.map +1 -0
  216. package/x/utils/identifier.d.ts +6 -0
  217. package/x/utils/identifier.js +25 -0
  218. package/x/utils/identifier.js.map +1 -0
  219. package/x/utils/insert.d.ts +1 -0
  220. package/x/utils/insert.js +5 -0
  221. package/x/utils/insert.js.map +1 -0
  222. package/x/utils/is-down.d.ts +1 -0
  223. package/x/utils/is-down.js +4 -0
  224. package/x/utils/is-down.js.map +1 -0
  225. package/x/utils/make-id.d.ts +1 -0
  226. package/x/utils/make-id.js +5 -0
  227. package/x/utils/make-id.js.map +1 -0
  228. package/x/utils/remap.d.ts +1 -0
  229. package/x/utils/remap.js +6 -0
  230. package/x/utils/remap.js.map +1 -0
  231. package/x/utils/shift-limit.d.ts +2 -0
  232. package/x/utils/shift-limit.js +7 -0
  233. package/x/utils/shift-limit.js.map +1 -0
  234. package/x/utils/sort-by-key.d.ts +1 -0
  235. package/x/utils/sort-by-key.js +6 -0
  236. package/x/utils/sort-by-key.js.map +1 -0
  237. package/x/utils/{quick-math.d.ts → tmax.d.ts} +0 -1
  238. package/x/utils/tmax.js +6 -0
  239. package/x/utils/tmax.js.map +1 -0
  240. package/x/utils/tmin.d.ts +1 -0
  241. package/x/utils/tmin.js +6 -0
  242. package/x/utils/tmin.js.map +1 -0
  243. package/s/tests.test.ts +0 -6
  244. package/x/core/bindings/action.js +0 -24
  245. package/x/core/bindings/action.js.map +0 -1
  246. package/x/core/bindings/parts/defaults.js.map +0 -1
  247. package/x/core/bindings/parts/is-pressed.d.ts +0 -1
  248. package/x/core/bindings/parts/is-pressed.js +0 -4
  249. package/x/core/bindings/parts/is-pressed.js.map +0 -1
  250. package/x/core/bindings/parts/lens-algo.js.map +0 -1
  251. package/x/core/bindings/parts/lookup-proxies.js +0 -19
  252. package/x/core/bindings/parts/lookup-proxies.js.map +0 -1
  253. package/x/core/bindings/resolver.d.ts +0 -9
  254. package/x/core/bindings/resolver.js.map +0 -1
  255. package/x/core/bindings/sample-map.d.ts +0 -7
  256. package/x/core/bindings/sample-map.js.map +0 -1
  257. package/x/core/bindings/types.js +0 -4
  258. package/x/core/bindings/types.js.map +0 -1
  259. package/x/core/core.test.d.ts +0 -13
  260. package/x/core/core.test.js +0 -138
  261. package/x/core/core.test.js.map +0 -1
  262. package/x/core/devices/auto-gamepads.d.ts +0 -2
  263. package/x/core/devices/auto-gamepads.js +0 -6
  264. package/x/core/devices/auto-gamepads.js.map +0 -1
  265. package/x/core/devices/device.d.ts +0 -5
  266. package/x/core/devices/device.js +0 -7
  267. package/x/core/devices/device.js.map +0 -1
  268. package/x/core/devices/infra/group.d.ts +0 -7
  269. package/x/core/devices/infra/group.js +0 -21
  270. package/x/core/devices/infra/group.js.map +0 -1
  271. package/x/core/devices/infra/sampler.d.ts +0 -9
  272. package/x/core/devices/infra/sampler.js +0 -18
  273. package/x/core/devices/infra/sampler.js.map +0 -1
  274. package/x/core/devices/standard/gamepad.d.ts +0 -11
  275. package/x/core/devices/standard/gamepad.js +0 -65
  276. package/x/core/devices/standard/gamepad.js.map +0 -1
  277. package/x/core/devices/standard/index.d.ts +0 -6
  278. package/x/core/devices/standard/index.js +0 -7
  279. package/x/core/devices/standard/index.js.map +0 -1
  280. package/x/core/devices/standard/keyboard.js.map +0 -1
  281. package/x/core/devices/standard/pointer.js.map +0 -1
  282. package/x/core/devices/standard/primary.d.ts +0 -10
  283. package/x/core/devices/standard/primary.js +0 -17
  284. package/x/core/devices/standard/primary.js.map +0 -1
  285. package/x/core/devices/standard/stick.js.map +0 -1
  286. package/x/core/devices/standard/vpad.d.ts +0 -7
  287. package/x/core/devices/standard/vpad.js +0 -20
  288. package/x/core/devices/standard/vpad.js.map +0 -1
  289. package/x/core/devices/types.d.ts +0 -1
  290. package/x/core/hub/hub.d.ts +0 -32
  291. package/x/core/hub/hub.js +0 -101
  292. package/x/core/hub/hub.js.map +0 -1
  293. package/x/core/hub/meta-bindings.d.ts +0 -2
  294. package/x/core/hub/meta-bindings.js +0 -21
  295. package/x/core/hub/meta-bindings.js.map +0 -1
  296. package/x/core/hub/parts/connected.d.ts +0 -14
  297. package/x/core/hub/parts/connected.js +0 -12
  298. package/x/core/hub/parts/connected.js.map +0 -1
  299. package/x/core/hub/port.d.ts +0 -9
  300. package/x/core/hub/port.js +0 -19
  301. package/x/core/hub/port.js.map +0 -1
  302. package/x/core/hub/types.d.ts +0 -9
  303. package/x/core/hub/types.js +0 -2
  304. package/x/core/hub/types.js.map +0 -1
  305. package/x/core/index.d.ts +0 -15
  306. package/x/core/index.js +0 -16
  307. package/x/core/index.js.map +0 -1
  308. package/x/core/testing/testing.d.ts +0 -52
  309. package/x/core/testing/testing.js +0 -45
  310. package/x/core/testing/testing.js.map +0 -1
  311. package/x/deck/index.d.ts +0 -9
  312. package/x/deck/index.js +0 -10
  313. package/x/deck/index.js.map +0 -1
  314. package/x/deck/parts/catalog.d.ts +0 -22
  315. package/x/deck/parts/catalog.js +0 -35
  316. package/x/deck/parts/catalog.js.map +0 -1
  317. package/x/deck/parts/db.d.ts +0 -17
  318. package/x/deck/parts/db.js +0 -52
  319. package/x/deck/parts/db.js.map +0 -1
  320. package/x/deck/parts/device-skins/device-icons.d.ts +0 -12
  321. package/x/deck/parts/device-skins/device-icons.js +0 -27
  322. package/x/deck/parts/device-skins/device-icons.js.map +0 -1
  323. package/x/deck/parts/device-skins/device-skin.d.ts +0 -14
  324. package/x/deck/parts/device-skins/device-skin.js +0 -22
  325. package/x/deck/parts/device-skins/device-skin.js.map +0 -1
  326. package/x/deck/parts/local-storage-kv.d.ts +0 -2
  327. package/x/deck/parts/local-storage-kv.js +0 -6
  328. package/x/deck/parts/local-storage-kv.js.map +0 -1
  329. package/x/deck/parts/merge-bindings.d.ts +0 -2
  330. package/x/deck/parts/merge-bindings.js +0 -15
  331. package/x/deck/parts/merge-bindings.js.map +0 -1
  332. package/x/deck/parts/overlay-visibility.d.ts +0 -18
  333. package/x/deck/parts/overlay-visibility.js +0 -35
  334. package/x/deck/parts/overlay-visibility.js.map +0 -1
  335. package/x/deck/views/bindings/style.css.js +0 -5
  336. package/x/deck/views/bindings/style.css.js.map +0 -1
  337. package/x/deck/views/bindings/view.d.ts +0 -2
  338. package/x/deck/views/bindings/view.js +0 -80
  339. package/x/deck/views/bindings/view.js.map +0 -1
  340. package/x/deck/views/overlay/style.css.js +0 -109
  341. package/x/deck/views/overlay/style.css.js.map +0 -1
  342. package/x/deck/views/overlay/view.d.ts +0 -2
  343. package/x/deck/views/overlay/view.js +0 -40
  344. package/x/deck/views/overlay/view.js.map +0 -1
  345. package/x/demo/game/game.d.ts +0 -17
  346. package/x/demo/game/game.js +0 -63
  347. package/x/demo/game/game.js.map +0 -1
  348. package/x/demo/game/parts/agent.d.ts +0 -7
  349. package/x/demo/game/parts/agent.js +0 -8
  350. package/x/demo/game/parts/agent.js.map +0 -1
  351. package/x/demo/game/parts/game-bindings.d.ts +0 -15
  352. package/x/demo/game/parts/game-bindings.js +0 -10
  353. package/x/demo/game/parts/game-bindings.js.map +0 -1
  354. package/x/demo/game/parts/logic.d.ts +0 -8
  355. package/x/demo/game/parts/logic.js +0 -21
  356. package/x/demo/game/parts/logic.js.map +0 -1
  357. package/x/demo/game/parts/player.d.ts +0 -14
  358. package/x/demo/game/parts/player.js +0 -26
  359. package/x/demo/game/parts/player.js.map +0 -1
  360. package/x/demo/game/parts/renderer.d.ts +0 -13
  361. package/x/demo/game/parts/renderer.js +0 -91
  362. package/x/demo/game/parts/renderer.js.map +0 -1
  363. package/x/demo/game/parts/state.d.ts +0 -8
  364. package/x/demo/game/parts/state.js +0 -20
  365. package/x/demo/game/parts/state.js.map +0 -1
  366. package/x/demo/game/parts/virtual-device.d.ts +0 -8
  367. package/x/demo/game/parts/virtual-device.js +0 -11
  368. package/x/demo/game/parts/virtual-device.js.map +0 -1
  369. package/x/demo/ui/theater/styles.css.d.ts +0 -1
  370. package/x/demo/ui/theater/styles.css.js +0 -57
  371. package/x/demo/ui/theater/styles.css.js.map +0 -1
  372. package/x/demo/ui/theater/view.d.ts +0 -2
  373. package/x/demo/ui/theater/view.js +0 -45
  374. package/x/demo/ui/theater/view.js.map +0 -1
  375. package/x/demo/ui/theater/virtual/style.css.js +0 -42
  376. package/x/demo/ui/theater/virtual/style.css.js.map +0 -1
  377. package/x/demo/ui/theater/virtual/view.d.ts +0 -4
  378. package/x/demo/ui/theater/virtual/view.js +0 -19
  379. package/x/demo/ui/theater/virtual/view.js.map +0 -1
  380. package/x/demo/ui/utils/loader.d.ts +0 -2
  381. package/x/demo/ui/utils/loader.js +0 -3
  382. package/x/demo/ui/utils/loader.js.map +0 -1
  383. package/x/nubs/index.d.ts +0 -3
  384. package/x/nubs/index.js +0 -4
  385. package/x/nubs/index.js.map +0 -1
  386. package/x/nubs/lookpad/styles.d.ts +0 -1
  387. package/x/nubs/lookpad/styles.js +0 -21
  388. package/x/nubs/lookpad/styles.js.map +0 -1
  389. package/x/nubs/lookpad/view.d.ts +0 -1
  390. package/x/nubs/lookpad/view.js +0 -33
  391. package/x/nubs/lookpad/view.js.map +0 -1
  392. package/x/nubs/stick/style.css.d.ts +0 -2
  393. package/x/nubs/stick/style.css.js +0 -69
  394. package/x/nubs/stick/style.css.js.map +0 -1
  395. package/x/nubs/stick/view.d.ts +0 -2
  396. package/x/nubs/stick/view.js +0 -95
  397. package/x/nubs/stick/view.js.map +0 -1
  398. package/x/nubs/vpad/styles.css.d.ts +0 -2
  399. package/x/nubs/vpad/styles.css.js +0 -133
  400. package/x/nubs/vpad/styles.css.js.map +0 -1
  401. package/x/nubs/vpad/utils/gamepad-inputs.d.ts +0 -29
  402. package/x/nubs/vpad/utils/gamepad-inputs.js +0 -31
  403. package/x/nubs/vpad/utils/gamepad-inputs.js.map +0 -1
  404. package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.d.ts +0 -1
  405. package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js +0 -9
  406. package/x/nubs/vpad/utils/prevent-default-touch-shenanigans.js.map +0 -1
  407. package/x/nubs/vpad/utils/touch-tracking.d.ts +0 -6
  408. package/x/nubs/vpad/utils/touch-tracking.js +0 -55
  409. package/x/nubs/vpad/utils/touch-tracking.js.map +0 -1
  410. package/x/nubs/vpad/view.d.ts +0 -2
  411. package/x/nubs/vpad/view.js +0 -123
  412. package/x/nubs/vpad/view.js.map +0 -1
  413. package/x/tests.test.d.ts +0 -1
  414. package/x/tests.test.js +0 -4
  415. package/x/tests.test.js.map +0 -1
  416. package/x/utils/dispensers.d.ts +0 -7
  417. package/x/utils/dispensers.js +0 -16
  418. package/x/utils/dispensers.js.map +0 -1
  419. package/x/utils/gamepads.d.ts +0 -14
  420. package/x/utils/gamepads.js +0 -40
  421. package/x/utils/gamepads.js.map +0 -1
  422. package/x/utils/quick-math.js +0 -11
  423. package/x/utils/quick-math.js.map +0 -1
  424. /package/s/{core → _archive/core}/bindings/action.ts +0 -0
  425. /package/s/{core → _archive/core}/bindings/parts/defaults.ts +0 -0
  426. /package/s/{core → _archive/core}/bindings/parts/is-pressed.ts +0 -0
  427. /package/s/{core → _archive/core}/bindings/parts/lens-algo.ts +0 -0
  428. /package/s/{core → _archive/core}/bindings/parts/lookup-proxies.ts +0 -0
  429. /package/s/{core → _archive/core}/bindings/resolver.ts +0 -0
  430. /package/s/{core → _archive/core}/bindings/sample-map.ts +0 -0
  431. /package/s/{core → _archive/core}/bindings/types.ts +0 -0
  432. /package/s/{core → _archive/core}/core.test.ts +0 -0
  433. /package/s/{core → _archive/core}/devices/auto-gamepads.ts +0 -0
  434. /package/s/{core → _archive/core}/devices/device.ts +0 -0
  435. /package/s/{core → _archive/core}/devices/infra/group.ts +0 -0
  436. /package/s/{core → _archive/core}/devices/infra/sampler.ts +0 -0
  437. /package/s/{core → _archive/core}/devices/standard/gamepad.ts +0 -0
  438. /package/s/{core → _archive/core}/devices/standard/index.ts +0 -0
  439. /package/s/{core → _archive/core}/devices/standard/keyboard.ts +0 -0
  440. /package/s/{core → _archive/core}/devices/standard/pointer.ts +0 -0
  441. /package/s/{core → _archive/core}/devices/standard/primary.ts +0 -0
  442. /package/s/{core → _archive/core}/devices/standard/stick.ts +0 -0
  443. /package/s/{core → _archive/core}/devices/standard/vpad.ts +0 -0
  444. /package/s/{core → _archive/core}/devices/types.ts +0 -0
  445. /package/s/{core → _archive/core}/hub/hub.ts +0 -0
  446. /package/s/{core → _archive/core}/hub/meta-bindings.ts +0 -0
  447. /package/s/{core → _archive/core}/hub/parts/connected.ts +0 -0
  448. /package/s/{core → _archive/core}/hub/port.ts +0 -0
  449. /package/s/{core → _archive/core}/hub/types.ts +0 -0
  450. /package/s/{core → _archive/core}/index.ts +0 -0
  451. /package/s/{core → _archive/core}/testing/testing.ts +0 -0
  452. /package/s/{deck → _archive/deck}/index.ts +0 -0
  453. /package/s/{deck → _archive/deck}/parts/catalog.ts +0 -0
  454. /package/s/{deck → _archive/deck}/parts/db.ts +0 -0
  455. /package/s/{deck → _archive/deck}/parts/device-skins/device-icons.ts +0 -0
  456. /package/s/{deck → _archive/deck}/parts/device-skins/device-skin.ts +0 -0
  457. /package/s/{deck → _archive/deck}/parts/local-storage-kv.ts +0 -0
  458. /package/s/{deck → _archive/deck}/parts/merge-bindings.ts +0 -0
  459. /package/s/{deck → _archive/deck}/parts/overlay-visibility.ts +0 -0
  460. /package/s/{deck → _archive/deck}/views/bindings/style.css.ts +0 -0
  461. /package/s/{deck → _archive/deck}/views/bindings/view.ts +0 -0
  462. /package/s/{deck → _archive/deck}/views/overlay/style.css.ts +0 -0
  463. /package/s/{deck → _archive/deck}/views/overlay/view.ts +0 -0
  464. /package/s/{demo → _archive/demo}/game/game.ts +0 -0
  465. /package/s/{demo → _archive/demo}/game/parts/agent.ts +0 -0
  466. /package/s/{demo → _archive/demo}/game/parts/game-bindings.ts +0 -0
  467. /package/s/{demo → _archive/demo}/game/parts/logic.ts +0 -0
  468. /package/s/{demo → _archive/demo}/game/parts/player.ts +0 -0
  469. /package/s/{demo → _archive/demo}/game/parts/renderer.ts +0 -0
  470. /package/s/{demo → _archive/demo}/game/parts/state.ts +0 -0
  471. /package/s/{demo → _archive/demo}/game/parts/virtual-device.ts +0 -0
  472. /package/s/{demo → _archive/demo}/ui/theater/styles.css.ts +0 -0
  473. /package/s/{demo → _archive/demo}/ui/theater/view.ts +0 -0
  474. /package/s/{demo → _archive/demo}/ui/theater/virtual/style.css.ts +0 -0
  475. /package/s/{demo → _archive/demo}/ui/theater/virtual/view.ts +0 -0
  476. /package/s/{demo → _archive/demo}/ui/utils/loader.ts +0 -0
  477. /package/s/{nubs → _archive/nubs}/index.ts +0 -0
  478. /package/s/{nubs → _archive/nubs}/lookpad/styles.ts +0 -0
  479. /package/s/{nubs → _archive/nubs}/lookpad/view.ts +0 -0
  480. /package/s/{nubs → _archive/nubs}/stick/style.css.ts +0 -0
  481. /package/s/{nubs → _archive/nubs}/stick/view.ts +0 -0
  482. /package/s/{nubs → _archive/nubs}/vpad/styles.css.ts +0 -0
  483. /package/s/{nubs → _archive/nubs}/vpad/utils/gamepad-inputs.ts +0 -0
  484. /package/s/{nubs → _archive/nubs}/vpad/utils/prevent-default-touch-shenanigans.ts +0 -0
  485. /package/s/{nubs → _archive/nubs}/vpad/utils/touch-tracking.ts +0 -0
  486. /package/s/{nubs → _archive/nubs}/vpad/view.ts +0 -0
  487. /package/s/{utils → _archive/utils}/dispensers.ts +0 -0
  488. /package/s/{utils → _archive/utils}/gamepads.ts +0 -0
  489. /package/s/{utils → _archive/utils}/quick-math.ts +0 -0
  490. /package/x/core/{bindings/parts → atom}/defaults.js +0 -0
  491. /package/x/core/{devices → atom}/types.js +0 -0
  492. /package/x/{deck/views/bindings → demo/demo-app}/style.css.d.ts +0 -0
  493. /package/x/{deck/views/overlay → gamepad/gamepad-app}/style.css.d.ts +0 -0
  494. /package/x/{core/bindings/parts/lookup-proxies.d.ts → gamepad/main.bundle.d.ts} +0 -0
  495. /package/x/{demo/ui/theater/virtual → ui/views/desk}/style.css.d.ts +0 -0
@@ -1,80 +0,0 @@
1
- import { html } from "lit";
2
- import { bytename } from "@e280/stz";
3
- import { cssReset, shadow, useCss, useName, useSignal } from "@e280/sly";
4
- import styleCss from "./style.css.js";
5
- export const DeckBindings = shadow((deck) => {
6
- useCss(cssReset, styleCss);
7
- useName("deck-bindings");
8
- const { db, hub } = deck;
9
- const catalog = db.$catalog();
10
- const defaultProfile = { id: "default", label: "default", bindings: deck.baseBindings };
11
- const allProfiles = [defaultProfile, ...catalog.profiles.values()];
12
- const $selectedProfileId = useSignal("default");
13
- const profile = db.$catalog().getProfile($selectedProfileId()) ?? defaultProfile;
14
- function renderPort(_port, index) {
15
- const portProfile = catalog.getProfileForPort(index) ?? defaultProfile;
16
- return html `
17
- <div class=port>
18
- <span>port ${index + 1}</span>
19
- <select>
20
- ${allProfiles.map(profile => html `
21
- <option
22
- data-id="${profile.id}"
23
- ?selected="${profile.id === portProfile.id}">
24
- ${profile.label}
25
- </option>
26
- `)}
27
- </select>
28
- </div>
29
- `;
30
- }
31
- function renderBindingBracket(entry) {
32
- const [mode, bracket] = entry;
33
- return html `
34
- <div class=bracket>
35
- <strong class=mode>${mode}</strong>
36
- <div>${Object.entries(bracket).map(renderBinds)}</div>
37
- </div>
38
- `;
39
- }
40
- function renderBinds([action, _atom]) {
41
- return html `
42
- <div class=bind>
43
- <span class=action>${action}</span>
44
- </div>
45
- `;
46
- }
47
- const clickClone = async () => {
48
- const { bindings } = profile;
49
- const label = bytename.random(4);
50
- const p = await db.createProfile(label, bindings);
51
- $selectedProfileId(p.id);
52
- };
53
- const deleteProfile = (id) => async () => {
54
- await db.deleteProfile(id);
55
- };
56
- const onSelected = (event) => {
57
- const select = event.target;
58
- const id = select.value;
59
- $selectedProfileId(id);
60
- };
61
- return html `
62
- <div class=portlist>
63
- ${hub.ports.map(renderPort)}
64
- </div>
65
-
66
- <div class=bindable>
67
- <select @input="${onSelected}">
68
- ${allProfiles.map(p => html `
69
- <option value="${p.id}" ?selected="${p.id === profile.id}">${p.label}</option>
70
- `)}
71
- </select>
72
- <button @click="${clickClone}">clone</button>
73
- <button ?disabled="${profile.id === defaultProfile.id}" @click="${deleteProfile(profile.id)}">delete</button>
74
- <div class=bindings>
75
- ${Object.entries(profile.bindings).map(renderBindingBracket)}
76
- </div>
77
- </div>
78
- `;
79
- });
80
- //# sourceMappingURL=view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../s/deck/views/bindings/view.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAC,MAAM,WAAW,CAAA;AAClC,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,WAAW,CAAA;AAGtE,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAKrC,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,CAAC,IAAe,EAAE,EAAE;IACtD,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1B,OAAO,CAAC,eAAe,CAAC,CAAA;IACxB,MAAM,EAAC,EAAE,EAAE,GAAG,EAAC,GAAG,IAAI,CAAA;IAEtB,MAAM,OAAO,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAA;IAC7B,MAAM,cAAc,GAAY,EAAC,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,YAAY,EAAC,CAAA;IAC9F,MAAM,WAAW,GAAG,CAAC,cAAc,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;IAClE,MAAM,kBAAkB,GAAG,SAAS,CAAC,SAAS,CAAC,CAAA;IAC/C,MAAM,OAAO,GAAG,EAAE,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AAE,CAAC,CAAA;IAC3B,CAAC,CAAA;IAED,MAAM,UAAU,GAAG,CAAC,KAAiB,EAAE,EAAE;QACxC,MAAM,MAAM,GAAG,KAAK,CAAC,MAA2B,CAAA;QAChD,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAA;QACvB,kBAAkB,CAAC,EAAE,CAAC,CAAA;IACvB,CAAC,CAAA;IAED,OAAO,IAAI,CAAA;;KAEP,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC;;;;qBAIT,UAAU;MACzB,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAA;sBACT,CAAC,CAAC,EAAE,gBAAgB,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC,KAAK;KACpE,CAAC;;qBAEe,UAAU;wBACP,OAAO,CAAC,EAAE,KAAK,cAAc,CAAC,EAAE,aAAa,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;;MAExF,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC;;;EAG9D,CAAA;AACF,CAAC,CAAC,CAAA"}
@@ -1,109 +0,0 @@
1
- import { css } from "lit";
2
- export default css `
3
-
4
- :host {
5
- --gap: 0.3em;
6
- pointer-events: none;
7
- cursor: default;
8
- user-select: none;
9
- }
10
-
11
- .portlist {
12
- pointer-events: none;
13
-
14
- display: flex;
15
- align-items: start;
16
-
17
- width: max-content;
18
- gap: var(--gap);
19
- padding: 0.5em;
20
-
21
- color: #fff8;
22
- background: #222a;
23
- border-radius: 1em;
24
-
25
- opacity: 0;
26
- transition: opacity 300ms linear;
27
-
28
- &[data-active] {
29
- opacity: 1;
30
- pointer-events: all;
31
- }
32
-
33
- .port {
34
- flex: 1 0 0;
35
- display: flex;
36
- flex-direction: column;
37
-
38
- min-width: 6em;
39
- gap: var(--gap);
40
-
41
- > * {
42
- color: white;
43
- font-weight: bold;
44
- text-shadow: 0.05em 0.05em 0.1em #0008;
45
- text-transform: uppercase;
46
- }
47
-
48
- header {
49
- text-align: center;
50
- color: #fff8;
51
- }
52
-
53
- .device {
54
- display: flex;
55
- flex-direction: column;
56
- gap: var(--gap);
57
-
58
- box-shadow: 0.1em 0.2em 0.7em #0004;
59
- background: color-mix(in srgb, #fffa, var(--color) 50%);
60
- border-top: 2px solid #fff8;
61
- border-bottom: 2px solid #0004;
62
- border-radius: 0.5em;
63
-
64
- .row {
65
- display: flex;
66
- align-items: center;
67
-
68
- &.primary {
69
- justify-content: space-between;
70
- }
71
-
72
- &.secondary {
73
- justify-content: center;
74
- }
75
- }
76
-
77
- .icon {
78
- font-size: 1.5em;
79
- }
80
-
81
- .label {
82
- font-family: monospace;
83
- font-size: 0.8em;
84
- opacity: 0.5;
85
- line-height: 0.9em;
86
- }
87
-
88
- button {
89
- opacity: 0.2;
90
- cursor: pointer;
91
- padding: 0 0.2em;
92
- font-family: monospace;
93
- font-size: 1.5em;
94
- font-weight: bold;
95
-
96
- background: transparent;
97
- border: 1px solid transparent;
98
- text-shadow: inherit;
99
-
100
- &:is(:hover, :focus-visible) {
101
- opacity: 1;
102
- }
103
- }
104
- }
105
- }
106
- }
107
-
108
- `;
109
- //# sourceMappingURL=style.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"style.css.js","sourceRoot":"","sources":["../../../../s/deck/views/overlay/style.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAA;AACvB,eAAe,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GjB,CAAA"}
@@ -1,2 +0,0 @@
1
- import { Deck } from "../../deck.js";
2
- export declare const DeckOverlay: import("@e280/sly").ShadowView<[deck: Deck<any, any>]>;
@@ -1,40 +0,0 @@
1
- import { html } from "lit";
2
- import { cssReset, shadow, useCss, useName } from "@e280/sly";
3
- import styleCss from "./style.css.js";
4
- export const DeckOverlay = shadow((deck) => {
5
- useCss(cssReset, styleCss);
6
- useName("deck-overlay");
7
- const { hub, deviceSkins, overlayVisibility: { $visible, $showLabels } } = deck;
8
- function renderDevice(device) {
9
- const skin = deviceSkins.get(device);
10
- const style = `--color: ${skin.color};`;
11
- const next = () => hub.shimmy(device, 1);
12
- const previous = () => hub.shimmy(device, -1);
13
- return html `
14
- <div class=device style="${style}">
15
- <div class="primary row">
16
- <button @click="${previous}">&lt;</button>
17
- <div class=icon>${skin.icon}</div>
18
- <button @click="${next}">&gt;</button>
19
- </div>
20
-
21
- ${$showLabels() ? html `
22
- <div class="secondary row">
23
- <div class=label>${skin.label}</div>
24
- </div>
25
- ` : null}
26
- </div>
27
- `;
28
- }
29
- return html `
30
- <div class=portlist ?data-active="${$visible()}">
31
- ${hub.ports.map((port, index) => html `
32
- <div class=port>
33
- <header>P${index + 1}</header>
34
- ${port.devices.array().map(renderDevice)}
35
- </div>
36
- `)}
37
- </div>
38
- `;
39
- });
40
- //# sourceMappingURL=view.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../s/deck/views/overlay/view.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,KAAK,CAAA;AACxB,OAAO,EAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAC,MAAM,WAAW,CAAA;AAE3D,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAGrC,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,IAAe,EAAE,EAAE;IACrD,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;IAC1B,OAAO,CAAC,cAAc,CAAC,CAAA;IACvB,MAAM,EAAC,GAAG,EAAE,WAAW,EAAE,iBAAiB,EAAE,EAAC,QAAQ,EAAE,WAAW,EAAC,EAAC,GAAG,IAAI,CAAA;IAE3E,SAAS,YAAY,CAAC,MAAc;QACnC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QACpC,MAAM,KAAK,GAAG,YAAY,IAAI,CAAC,KAAK,GAAG,CAAA;QACvC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;QACxC,MAAM,QAAQ,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAA;QAC7C,OAAO,IAAI,CAAA;8BACiB,KAAK;;uBAEZ,QAAQ;uBACR,IAAI,CAAC,IAAI;uBACT,IAAI;;;MAGrB,WAAW,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;;yBAED,IAAI,CAAC,KAAK;;KAE9B,CAAC,CAAC,CAAC,IAAI;;GAET,CAAA;IACF,CAAC;IAED,OAAO,IAAI,CAAA;sCAC0B,QAAQ,EAAE;KAC3C,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAA;;gBAExB,KAAK,GAAG,CAAC;OAClB,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC;;IAEzC,CAAC;;EAEH,CAAA;AACF,CAAC,CAAC,CAAA"}
@@ -1,17 +0,0 @@
1
- import { Logic } from "./parts/logic.js";
2
- import { State } from "./parts/state.js";
3
- import { Renderer } from "./parts/renderer.js";
4
- import { Device } from "../../core/devices/device.js";
5
- import { GameDeck } from "./parts/game-bindings.js";
6
- export declare class Game {
7
- deck: GameDeck;
8
- static load(): Promise<Game>;
9
- logic: Logic;
10
- dispose: import("@e280/stz").Disposer;
11
- state: State;
12
- renderer: Renderer;
13
- constructor(deck: GameDeck);
14
- plug(device: Device): () => void;
15
- unplug(device: Device): void;
16
- loop(hz: number): () => void;
17
- }
@@ -1,63 +0,0 @@
1
- import { disposer, nap, repeat } from "@e280/stz";
2
- import { Logic } from "./parts/logic.js";
3
- import { State } from "./parts/state.js";
4
- import { Deck } from "../../deck/deck.js";
5
- import { Players } from "./parts/player.js";
6
- import { Renderer } from "./parts/renderer.js";
7
- import { VirtualDevice } from "./parts/virtual-device.js";
8
- import { gameBindings } from "./parts/game-bindings.js";
9
- import { autoGamepads } from "../../core/devices/auto-gamepads.js";
10
- import { localStorageKv } from "../../deck/parts/local-storage-kv.js";
11
- import { PrimaryDevice } from "../../core/devices/standard/primary.js";
12
- export class Game {
13
- deck;
14
- static async load() {
15
- return new this(await Deck.load({
16
- portCount: 4,
17
- kv: localStorageKv(),
18
- bindings: gameBindings,
19
- }));
20
- }
21
- logic;
22
- dispose = disposer();
23
- state = new State();
24
- renderer = new Renderer(this.state);
25
- constructor(deck) {
26
- this.deck = deck;
27
- // add an icon for our demo virtual device
28
- this.deck.deviceSkins.icons.add([VirtualDevice, "🔘"]);
29
- // establish game logic
30
- this.logic = new Logic(this.state, new Players(deck.hub, this.state));
31
- // on hub update, set agent.alive based on port status
32
- this.dispose.schedule(this.deck.hub.on(() => {
33
- for (const player of this.logic.players) {
34
- player.agent.alive = player.port.devices.size > 0;
35
- const [firstDevice] = player.port.devices;
36
- player.agent.color = firstDevice
37
- ? this.deck.deviceSkins.get(firstDevice).color
38
- : "#444";
39
- }
40
- }));
41
- // plug in initial devices
42
- this.plug(new PrimaryDevice());
43
- this.plug(new VirtualDevice(deck.hub));
44
- // dynamically plug in detected gamepads
45
- this.dispose.schedule(autoGamepads(deck.hub.plug));
46
- }
47
- plug(device) {
48
- this.deck.hub.plug(device);
49
- return () => this.unplug(device);
50
- }
51
- unplug(device) {
52
- this.deck.hub.unplug(device);
53
- }
54
- loop(hz) {
55
- return repeat(async () => {
56
- await nap(1000 / hz);
57
- this.deck.hub.poll();
58
- this.logic.tick();
59
- this.renderer.render();
60
- });
61
- }
62
- }
63
- //# sourceMappingUR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jC,CAAC;IAED,MAAM,CAAC,MAAc;QACpB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAC7B,CAAC;IAED,IAAI,CAAC,EAAU;QACd,OAAO,MAAM,CAAC,KAAK,IAAG,EAAE;YACvB,MAAM,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC,CAAA;YACpB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAA;YACpB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAA;YACjB,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAA;QACvB,CAAC,CAAC,CAAA;IACH,CAAC;CACD"}
@@ -1,7 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- export declare class Agent {
3
- label: string;
4
- alive: boolean;
5
- color: string;
6
- position: Vec2;
7
- }
@@ -1,8 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- export class Agent {
3
- label = "0";
4
- alive = true;
5
- color = "#444";
6
- position = Vec2.zero();
7
- }
8
- //# sourceMappingURL=agent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"agent.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAEhC,MAAM,OAAO,KAAK;IACjB,KAAK,GAAG,GAAG,CAAA;IACX,KAAK,GAAG,IAAI,CAAA;IACZ,KAAK,GAAG,MAAM,CAAA;IACd,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,CAAA;CACtB"}
@@ -1,15 +0,0 @@
1
- import { Deck } from "../../../deck/deck.js";
2
- import { Hub } from "../../../core/hub/hub.js";
3
- import { Port } from "../../../core/hub/port.js";
4
- export type GameBindings = typeof gameBindings;
5
- export type GamePort = Port<GameBindings>;
6
- export type GameDeck = Deck<GameBindings>;
7
- export type GameHub = Hub<GameBindings>;
8
- export declare const gameBindings: {
9
- gameplay: {
10
- up: ["or", string, string, string, string, string];
11
- down: ["or", string, string, string, string, string];
12
- left: ["or", string, string, string, string, string];
13
- right: ["or", string, string, string, string, string];
14
- };
15
- };
@@ -1,10 +0,0 @@
1
- import { asBindings } from "../../../core/bindings/types.js";
2
- export const gameBindings = asBindings({
3
- gameplay: {
4
- up: ["or", "KeyW", "ArrowUp", "stick.up", "gamepad.stick.left.up", "gamepad.stick.right.up"],
5
- down: ["or", "KeyS", "ArrowDown", "stick.down", "gamepad.stick.left.down", "gamepad.stick.right.down"],
6
- left: ["or", "KeyA", "ArrowLeft", "stick.left", "gamepad.stick.left.left", "gamepad.stick.right.left"],
7
- right: ["or", "KeyD", "ArrowRight", "stick.right", "gamepad.stick.left.right", "gamepad.stick.right.right"],
8
- },
9
- });
10
- //# sourceMappingURL=game-bindings.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"game-bindings.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/game-bindings.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAA;AAO1D,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACtC,QAAQ,EAAE;QACT,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,uBAAuB,EAAE,wBAAwB,CAAC;QAC5F,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,yBAAyB,EAAE,0BAA0B,CAAC;QACtG,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,yBAAyB,EAAE,0BAA0B,CAAC;QACtG,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,0BAA0B,EAAE,2BAA2B,CAAC;KAC3G;CACD,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- import { State } from "./state.js";
2
- import { Players } from "./player.js";
3
- export declare class Logic {
4
- state: State;
5
- players: Players;
6
- constructor(state: State, players: Players);
7
- tick(): void;
8
- }
@@ -1,21 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- export class Logic {
3
- state;
4
- players;
5
- constructor(state, players) {
6
- this.state = state;
7
- this.players = players;
8
- }
9
- tick() {
10
- for (const player of this.players) {
11
- const { agent, port: { actions } } = player;
12
- const speed = 1;
13
- agent.position.y += speed * actions.gameplay.up.value;
14
- agent.position.y -= speed * actions.gameplay.down.value;
15
- agent.position.x -= speed * actions.gameplay.left.value;
16
- agent.position.x += speed * actions.gameplay.right.value;
17
- agent.position.clamp(Vec2.zero(), this.state.arenaSize);
18
- }
19
- }
20
- }
21
- //# sourceMappingURL=logic.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"logic.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/logic.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAIhC,MAAM,OAAO,KAAK;IAET;IACA;IAFR,YACQ,KAAY,EACZ,OAAgB;QADhB,UAAK,GAAL,KAAK,CAAO;QACZ,YAAO,GAAP,OAAO,CAAS;IACrB,CAAC;IAEJ,IAAI;QACH,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,EAAC,KAAK,EAAE,IAAI,EAAE,EAAC,OAAO,EAAC,EAAC,GAAG,MAAM,CAAA;YACvC,MAAM,KAAK,GAAG,CAAC,CAAA;YACf,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAA;YACrD,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAA;YACvD,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAA;YACvD,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAA;YACxD,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;QACxD,CAAC;IACF,CAAC;CACD"}
@@ -1,14 +0,0 @@
1
- import { Agent } from "./agent.js";
2
- import { State } from "./state.js";
3
- import { GameHub, GamePort } from "./game-bindings.js";
4
- export declare class Player {
5
- port: GamePort;
6
- agent: Agent;
7
- constructor(port: GamePort, agent: Agent);
8
- }
9
- export declare class Players {
10
- #private;
11
- constructor(hub: GameHub, state: State);
12
- [Symbol.iterator](): MapIterator<Player>;
13
- require(port: GamePort): Player;
14
- }
@@ -1,26 +0,0 @@
1
- import { MapG } from "@e280/stz";
2
- export class Player {
3
- port;
4
- agent;
5
- constructor(port, agent) {
6
- this.port = port;
7
- this.agent = agent;
8
- }
9
- }
10
- export class Players {
11
- #map = new MapG();
12
- constructor(hub, state) {
13
- for (const [index, port] of hub.ports.entries()) {
14
- const label = (index + 1).toString();
15
- this.#map.set(port, new Player(port, state.makeAgent(label)));
16
- }
17
- }
18
- ;
19
- [Symbol.iterator]() {
20
- return this.#map.values();
21
- }
22
- require(port) {
23
- return this.#map.require(port);
24
- }
25
- }
26
- //# sourceMappingURL=player.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"player.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/player.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAA;AAK9B,MAAM,OAAO,MAAM;IAEV;IACA;IAFR,YACQ,IAAc,EACd,KAAY;QADZ,SAAI,GAAJ,IAAI,CAAU;QACd,UAAK,GAAL,KAAK,CAAO;IACjB,CAAC;CACJ;AAED,MAAM,OAAO,OAAO;IACnB,IAAI,GAAG,IAAI,IAAI,EAAoB,CAAA;IAEnC,YAAY,GAAY,EAAE,KAAY;QACrC,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;YACjD,MAAM,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAA;YACpC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAC9D,CAAC;IACF,CAAC;IAED,CAAC;IAAA,CAAC,MAAM,CAAC,QAAQ,CAAC;QACjB,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA;IAC1B,CAAC;IAED,OAAO,CAAC,IAAc;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;IAC/B,CAAC;CACD"}
@@ -1,13 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- import { State } from "./state.js";
3
- export declare class Renderer {
4
- #private;
5
- state: State;
6
- canvas: HTMLCanvasElement;
7
- ctx: CanvasRenderingContext2D;
8
- constructor(state: State);
9
- percent(n: number): number;
10
- /** take a game-state position and resolve it into canvas coordinates */
11
- resolve(position: Vec2): Vec2;
12
- render(): void;
13
- }
@@ -1,91 +0,0 @@
1
- export class Renderer {
2
- state;
3
- canvas = (() => {
4
- const canvas = document.createElement("canvas");
5
- canvas.width = 200;
6
- canvas.height = 100;
7
- return canvas;
8
- })();
9
- ctx = this.canvas.getContext("2d");
10
- constructor(state) {
11
- this.state = state;
12
- }
13
- percent(n) {
14
- const shorty = Math.min(this.canvas.width, this.canvas.height);
15
- return Math.ceil(shorty * (n / 100));
16
- }
17
- /** take a game-state position and resolve it into canvas coordinates */
18
- resolve(position) {
19
- return position.dup()
20
- // 0-1 relative to arena scale
21
- .div(this.state.arenaSize)
22
- // flip y axis
23
- .morph((v) => { v.y = 1 - v.y; })
24
- // stretch to the size of the canvas
25
- .mul_(this.canvas.width, this.canvas.height);
26
- }
27
- render() {
28
- const { state } = this;
29
- this.#renderBackground();
30
- const agents = [...state.agents].reverse();
31
- const dead = agents.filter(a => !a.alive);
32
- const alive = agents.filter(a => a.alive);
33
- for (const agent of dead)
34
- this.#renderDeadAgent(agent);
35
- for (const agent of alive)
36
- this.#renderAliveAgent(agent);
37
- }
38
- #getCleanCtx() {
39
- const { ctx } = this;
40
- ctx.imageSmoothingEnabled = false;
41
- ctx.fillStyle = "#000";
42
- ctx.strokeStyle = "#000";
43
- ctx.lineWidth = 1;
44
- ctx.font = `10px sans-serif`;
45
- ctx.textAlign = "center";
46
- ctx.textBaseline = "middle";
47
- return ctx;
48
- }
49
- #renderBackground() {
50
- const { canvas } = this;
51
- const ctx = this.#getCleanCtx();
52
- ctx.fillStyle = "#000";
53
- ctx.fillRect(0, 0, canvas.width, canvas.height);
54
- }
55
- #renderDeadAgent(agent) {
56
- const ctx = this.#getCleanCtx();
57
- const radius = this.percent(10);
58
- const { position } = agent;
59
- const [x, y] = this.resolve(position);
60
- // draw label
61
- ctx.font = `${radius * 1.3}px sans-serif`;
62
- ctx.textAlign = "center";
63
- ctx.textBaseline = "middle";
64
- ctx.fillStyle = "#fff4";
65
- ctx.fillText(agent.label, x, y);
66
- }
67
- #renderAliveAgent(agent) {
68
- const ctx = this.#getCleanCtx();
69
- const radius = this.percent(10);
70
- const { color, position } = agent;
71
- const [x, y] = this.resolve(position);
72
- // circle
73
- ctx.beginPath();
74
- ctx.arc(x, y, radius, 0, Math.PI * 2);
75
- ctx.fillStyle = color;
76
- ctx.fill();
77
- // outline
78
- ctx.lineWidth = this.percent(2);
79
- ctx.strokeStyle = "#fff";
80
- ctx.stroke();
81
- // draw label
82
- ctx.font = `${radius * 1.3}px sans-serif`;
83
- ctx.textAlign = "center";
84
- ctx.textBaseline = "middle";
85
- ctx.strokeStyle = "#0004";
86
- ctx.strokeText(agent.label, x, y);
87
- ctx.fillStyle = "#fff";
88
- ctx.fillText(agent.label, x, y);
89
- }
90
- }
91
- //# sourceMappingURL=renderer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"renderer.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/renderer.ts"],"names":[],"mappings":"AAKA,MAAM,OAAO,QAAQ;IAUD;IATnB,MAAM,GAAG,CAAC,GAAG,EAAE;QACd,MAAM,MAAM,GAAG,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAA;QAC/C,MAAM,CAAC,KAAK,GAAG,GAAG,CAAA;QAClB,MAAM,CAAC,MAAM,GAAG,GAAG,CAAA;QACnB,OAAO,MAAM,CAAA;IACd,CAAC,CAAC,EAAE,CAAA;IAEJ,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAE,CAAA;IAEnC,YAAmB,KAAY;QAAZ,UAAK,GAAL,KAAK,CAAO;IAAG,CAAC;IAEnC,OAAO,CAAC,CAAS;QAChB,MAAM,MAAM,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;QAC9D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;IACrC,CAAC;IAED,wEAAwE;IACxE,OAAO,CAAC,QAAc;QACrB,OAAO,QAAQ,CAAC,GAAG,EAAE;YAEpB,8BAA8B;aAC7B,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;YAE1B,cAAc;aACb,KAAK,CAAC,CAAC,CAAO,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA,CAAA,CAAC,CAAC;YAEpC,oCAAoC;aACnC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CA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IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;QAC/B,GAAG,CAAC,WAAW,GAAG,MAAM,CAAA;QACxB,GAAG,CAAC,MAAM,EAAE,CAAA;QAEZ,aAAa;QACb,GAAG,CAAC,IAAI,GAAG,GAAG,MAAM,GAAG,GAAG,eAAe,CAAA;QACzC,GAAG,CAAC,SAAS,GAAG,QAAQ,CAAA;QACxB,GAAG,CAAC,YAAY,GAAG,QAAQ,CAAA;QAC3B,GAAG,CAAC,WAAW,GAAG,OAAO,CAAA;QACzB,GAAG,CAAC,UAAU,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACjC,GAAG,CAAC,SAAS,GAAG,MAAM,CAAA;QACtB,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAChC,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- import { Agent } from "./agent.js";
3
- export declare class State {
4
- arenaSize: Vec2;
5
- agents: Set<Agent>;
6
- makeAgent(label: string): Agent;
7
- deleteAgent(agent: Agent): this;
8
- }
@@ -1,20 +0,0 @@
1
- import { Vec2 } from "@benev/math";
2
- import { Agent } from "./agent.js";
3
- export class State {
4
- arenaSize = new Vec2(200, 100);
5
- agents = new Set();
6
- makeAgent(label) {
7
- const agent = new Agent();
8
- agent.label = label;
9
- agent.position
10
- .set_(0.5, 0.5)
11
- .mul(this.arenaSize);
12
- this.agents.add(agent);
13
- return agent;
14
- }
15
- deleteAgent(agent) {
16
- this.agents.delete(agent);
17
- return this;
18
- }
19
- }
20
- //# sourceMappingURL=state.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"state.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/state.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAA;AAChC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAEhC,MAAM,OAAO,KAAK;IACjB,SAAS,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;IAC9B,MAAM,GAAG,IAAI,GAAG,EAAS,CAAA;IAEzB,SAAS,CAAC,KAAa;QACtB,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,KAAK,CAAC,KAAK,GAAG,KAAK,CAAA;QACnB,KAAK,CAAC,QAAQ;aACZ,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;aACd,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACrB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;QACtB,OAAO,KAAK,CAAA;IACb,CAAC;IAED,WAAW,CAAC,KAAY;QACvB,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;QACzB,OAAO,IAAI,CAAA;IACZ,CAAC;CACD"}
@@ -1,8 +0,0 @@
1
- import { Hub } from "../../../core/hub/hub.js";
2
- import { StickDevice } from "../../../core/devices/standard/stick.js";
3
- export declare class VirtualDevice extends StickDevice {
4
- private hub;
5
- constructor(hub: Hub<any>);
6
- shimmyNext: () => import("../../../index.js").Port<any>;
7
- shimmyPrevious: () => import("../../../index.js").Port<any>;
8
- }
@@ -1,11 +0,0 @@
1
- import { StickDevice } from "../../../core/devices/standard/stick.js";
2
- export class VirtualDevice extends StickDevice {
3
- hub;
4
- constructor(hub) {
5
- super();
6
- this.hub = hub;
7
- }
8
- shimmyNext = () => this.hub.shimmy(this, 1);
9
- shimmyPrevious = () => this.hub.shimmy(this, -1);
10
- }
11
- //# sourceMappingURL=virtual-device.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"virtual-device.js","sourceRoot":"","sources":["../../../../s/demo/game/parts/virtual-device.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,WAAW,EAAC,MAAM,yCAAyC,CAAA;AAEnE,MAAM,OAAO,aAAc,SAAQ,WAAW;IACzB;IAApB,YAAoB,GAAa;QAChC,KAAK,EAAE,CAAA;QADY,QAAG,GAAH,GAAG,CAAU;IAEjC,CAAC;IAED,UAAU,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;IAC3C,cAAc,GAAG,GAAG,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;CAChD"}
@@ -1 +0,0 @@
1
- export declare const styles: import("lit").CSSResult;