brick-engine-js 1.0.1
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/.env.local.example +2 -0
- package/.github/workflows/publish.yml +73 -0
- package/.prettierignore +2 -0
- package/.prettierrc.json +8 -0
- package/README.adoc +84 -0
- package/dist/8e23286c2fdf41fd795f.svg +32 -0
- package/dist/CNAME +1 -0
- package/dist/app.js +2 -0
- package/dist/app.js.map +1 -0
- package/dist/brick-engine.js +2 -0
- package/dist/brick-engine.js.map +1 -0
- package/dist/config/configs.d.ts +180 -0
- package/dist/config/configs.test.d.ts +1 -0
- package/dist/config/env.d.ts +2 -0
- package/dist/config/env.test.d.ts +1 -0
- package/dist/config/styles.d.ts +0 -0
- package/dist/core/Game.d.ts +107 -0
- package/dist/core/Game.test.d.ts +1 -0
- package/dist/core/InitialStateSnapshot.d.ts +19 -0
- package/dist/core/InitialStateSnapshot.test.d.ts +1 -0
- package/dist/core/helpers/CellHelper.d.ts +13 -0
- package/dist/core/helpers/CellHelper.test.d.ts +1 -0
- package/dist/core/helpers/ControlInputHandlerHelper.d.ts +32 -0
- package/dist/core/helpers/ControlInputHandlerHelper.test.d.ts +1 -0
- package/dist/core/helpers/CoordinateHelper.d.ts +54 -0
- package/dist/core/helpers/CoordinateHelper.test.d.ts +1 -0
- package/dist/core/helpers/InterfaceIdentifierHelper.d.ts +7 -0
- package/dist/core/helpers/InterfaceIdentifierHelper.test.d.ts +1 -0
- package/dist/core/helpers/RelativeValuesHelper.d.ts +23 -0
- package/dist/core/helpers/RelativeValuesHelper.test.d.ts +1 -0
- package/dist/core/module/control/GameControl.d.ts +62 -0
- package/dist/core/module/control/GameControl.test.d.ts +1 -0
- package/dist/core/module/control/GameControlKeyBinding.d.ts +36 -0
- package/dist/core/module/control/GameControlKeyBinding.test.d.ts +1 -0
- package/dist/core/module/grid/GameGrid.d.ts +399 -0
- package/dist/core/module/grid/GameGrid.test.d.ts +1 -0
- package/dist/core/module/grid/GameHudGrid.d.ts +24 -0
- package/dist/core/module/grid/GameHudGrid.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridAnalysisEngine.d.ts +29 -0
- package/dist/core/module/grid/engines/GridAnalysisEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridLineEngine.d.ts +56 -0
- package/dist/core/module/grid/engines/GridLineEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridMovementEngine.d.ts +29 -0
- package/dist/core/module/grid/engines/GridMovementEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridRegionEngine.d.ts +26 -0
- package/dist/core/module/grid/engines/GridRegionEngine.test.d.ts +1 -0
- package/dist/core/module/grid/engines/GridTransformEngine.d.ts +24 -0
- package/dist/core/module/grid/engines/GridTransformEngine.test.d.ts +1 -0
- package/dist/core/module/renderer/DisplayRenderer.d.ts +51 -0
- package/dist/core/module/renderer/DisplayRenderer.test.d.ts +1 -0
- package/dist/core/module/renderer/GameRenderer.d.ts +59 -0
- package/dist/core/module/renderer/GameRenderer.test.d.ts +1 -0
- package/dist/core/module/renderer/HudRenderer.d.ts +56 -0
- package/dist/core/module/renderer/HudRenderer.test.d.ts +1 -0
- package/dist/core/module/score/GameScore.d.ts +117 -0
- package/dist/core/module/score/GameScore.test.d.ts +1 -0
- package/dist/core/module/session/GameSession.d.ts +20 -0
- package/dist/core/module/session/GameSession.test.d.ts +1 -0
- package/dist/core/module/sound/GameSound.d.ts +85 -0
- package/dist/core/module/sound/GameSound.test.d.ts +1 -0
- package/dist/core/module/state/GameState.d.ts +172 -0
- package/dist/core/module/state/GameState.test.d.ts +1 -0
- package/dist/core/module/text/GameText.d.ts +87 -0
- package/dist/core/module/text/GameText.test.d.ts +1 -0
- package/dist/core/module/time/GameTime.d.ts +76 -0
- package/dist/core/module/time/GameTime.test.d.ts +1 -0
- package/dist/core/types/Interfaces.d.ts +53 -0
- package/dist/core/types/Types.d.ts +114 -0
- package/dist/core/types/enums.d.ts +106 -0
- package/dist/core/types/modules.d.ts +723 -0
- package/dist/css/app.743066d8e4172b0e73f9.css +824 -0
- package/dist/css/app.743066d8e4172b0e73f9.css.map +1 -0
- package/dist/docs/GAME_DEVELOPER_GUIDE.html +727 -0
- package/dist/docs/brick-engine-guide.html +610 -0
- package/dist/docs/diagrams/lifecycle.mmd +19 -0
- package/dist/docs/documentation_style_guide.html +994 -0
- package/dist/docs/getting-started.html +648 -0
- package/dist/docs/images/lifecycle.svg +1 -0
- package/dist/docs/index.html +593 -0
- package/dist/docs/jsdoc_standard.html +656 -0
- package/dist/docs/publishing.html +573 -0
- package/dist/docs/reference/enums/Color.html +533 -0
- package/dist/docs/reference/enums/ControlEventType.html +505 -0
- package/dist/docs/reference/enums/ControlKey.html +529 -0
- package/dist/docs/reference/enums/FontAlignment.html +545 -0
- package/dist/docs/reference/enums/FontSize.html +517 -0
- package/dist/docs/reference/enums/Sound.html +558 -0
- package/dist/docs/reference/enums/StateProperty.html +525 -0
- package/dist/docs/reference/helpers/CellHelper.html +520 -0
- package/dist/docs/reference/helpers/ControlInputHandlerHelper.html +569 -0
- package/dist/docs/reference/helpers/CoordinateHelper.html +703 -0
- package/dist/docs/reference/helpers/RelativeValuesHelper.html +560 -0
- package/dist/docs/reference/interfaces/Debuggable.html +501 -0
- package/dist/docs/reference/interfaces/GameModules.html +544 -0
- package/dist/docs/reference/interfaces/Initializable.html +495 -0
- package/dist/docs/reference/interfaces/RendererInitializable.html +517 -0
- package/dist/docs/reference/interfaces/StateSyncable.html +542 -0
- package/dist/docs/reference/interfaces/modules/Control.html +648 -0
- package/dist/docs/reference/interfaces/modules/Grid.html +1256 -0
- package/dist/docs/reference/interfaces/modules/Renderer.html +522 -0
- package/dist/docs/reference/interfaces/modules/RendererComposite.html +577 -0
- package/dist/docs/reference/interfaces/modules/Score.html +669 -0
- package/dist/docs/reference/interfaces/modules/Session.html +585 -0
- package/dist/docs/reference/interfaces/modules/State.html +897 -0
- package/dist/docs/reference/interfaces/modules/Text.html +668 -0
- package/dist/docs/reference/interfaces/modules/Time.html +684 -0
- package/dist/docs/reference/modules/Debugger.html +579 -0
- package/dist/docs/reference/modules/DisplayRenderer.html +557 -0
- package/dist/docs/reference/modules/Game.html +909 -0
- package/dist/docs/reference/modules/GameControl.html +716 -0
- package/dist/docs/reference/modules/GameGrid.html +1910 -0
- package/dist/docs/reference/modules/GameHudGrid.html +508 -0
- package/dist/docs/reference/modules/GameMenu.html +538 -0
- package/dist/docs/reference/modules/GameRenderer.html +589 -0
- package/dist/docs/reference/modules/GameScore.html +664 -0
- package/dist/docs/reference/modules/GameSession.html +533 -0
- package/dist/docs/reference/modules/GameSound.html +636 -0
- package/dist/docs/reference/modules/GameState.html +922 -0
- package/dist/docs/reference/modules/GameText.html +701 -0
- package/dist/docs/reference/modules/GameTime.html +696 -0
- package/dist/docs/reference/modules/HudRenderer.html +568 -0
- package/dist/docs/reference/modules/InitialStateSnapshot.html +557 -0
- package/dist/docs/reference/modules/SessionModal.html +520 -0
- package/dist/docs/reference/types/Axis.html +505 -0
- package/dist/docs/reference/types/Cell.html +514 -0
- package/dist/docs/reference/types/ControlCallback.html +488 -0
- package/dist/docs/reference/types/Coordinate.html +510 -0
- package/dist/docs/reference/types/GameEntry.html +514 -0
- package/dist/docs/reference/types/GameEvent.html +514 -0
- package/dist/docs/reference/types/Piece.html +506 -0
- package/dist/docs/reference/types/RendererMetrics.html +514 -0
- package/dist/docs/reference/types/Vector.html +509 -0
- package/dist/docs/testing_best_practices.html +770 -0
- package/dist/favicon.ico +0 -0
- package/dist/fonts/digital-7.monoitalic.ttf +0 -0
- package/dist/images/cell.svg +32 -0
- package/dist/images/close.png +0 -0
- package/dist/images/games.png +0 -0
- package/dist/images/github.png +0 -0
- package/dist/images/letter-a.png +0 -0
- package/dist/images/letter-d.png +0 -0
- package/dist/images/letter-j.png +0 -0
- package/dist/images/letter-s.png +0 -0
- package/dist/images/letter-w.png +0 -0
- package/dist/images/meta-image.png +0 -0
- package/dist/images/number-1.png +0 -0
- package/dist/images/number-2.png +0 -0
- package/dist/images/number-3.png +0 -0
- package/dist/images/number-4.png +0 -0
- package/dist/images/number-5.png +0 -0
- package/dist/images/number-6.png +0 -0
- package/dist/images/splash.gif +0 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.html +1 -0
- package/dist/index.test.d.ts +1 -0
- package/dist/main.d.ts +3 -0
- package/dist/main.test.d.ts +1 -0
- package/dist/menu/GameMenu.d.ts +15 -0
- package/dist/menu/GameMenu.test.d.ts +1 -0
- package/dist/menu/GameMenuSingleton.d.ts +6 -0
- package/dist/menu/GameMenuSingleton.test.d.ts +1 -0
- package/dist/menu/GameRepository.d.ts +7 -0
- package/dist/menu/GameRepository.test.d.ts +1 -0
- package/dist/menu/manager/GameManager.d.ts +6 -0
- package/dist/menu/manager/GameManager.test.d.ts +1 -0
- package/dist/sounds/sound_00.wav +0 -0
- package/dist/sounds/sound_01.wav +0 -0
- package/dist/sounds/sound_02.wav +0 -0
- package/dist/sounds/sound_03.wav +0 -0
- package/dist/sounds/sound_04.wav +0 -0
- package/dist/sounds/sound_05.wav +0 -0
- package/dist/sounds/sound_06.wav +0 -0
- package/dist/sounds/sound_07.wav +0 -0
- package/dist/sounds/sound_08.wav +0 -0
- package/dist/sounds/sound_09.wav +0 -0
- package/dist/sounds/sound_10.wav +0 -0
- package/dist/sounds/sound_11.wav +0 -0
- package/dist/sounds/sound_12.wav +0 -0
- package/dist/sounds/sound_13.wav +0 -0
- package/dist/sounds/sound_14.wav +0 -0
- package/dist/sounds/sound_15.wav +0 -0
- package/dist/types/interfaces.d.ts +5 -0
- package/dist/vendor/p5.min.js +1 -0
- package/dist/view/Debugger.d.ts +12 -0
- package/dist/view/Debugger.test.d.ts +1 -0
- package/dist/view/GameView.d.ts +101 -0
- package/dist/view/GameView.test.d.ts +1 -0
- package/dist/view/SessionModal.d.ts +12 -0
- package/dist/view/SessionModal.test.d.ts +4 -0
- package/dist/view/components/layout/ButtonLayout.d.ts +25 -0
- package/dist/view/components/layout/ButtonLayout.test.d.ts +1 -0
- package/dist/view/components/layout/ContainerLayout.d.ts +23 -0
- package/dist/view/components/layout/ContainerLayout.test.d.ts +1 -0
- package/dist/view/components/layout/FrameLayout.d.ts +11 -0
- package/dist/view/components/layout/FrameLayout.test.d.ts +1 -0
- package/dist/view/components/ui/BigButton.d.ts +13 -0
- package/dist/view/components/ui/BigButton.test.d.ts +1 -0
- package/dist/view/components/ui/Button.d.ts +12 -0
- package/dist/view/components/ui/Button.test.d.ts +1 -0
- package/dist/view/components/ui/Canvas.d.ts +22 -0
- package/dist/view/components/ui/Canvas.test.d.ts +1 -0
- package/dist/view/components/ui/SmallButton.d.ts +13 -0
- package/dist/view/components/ui/SmallButton.test.d.ts +1 -0
- package/dist/view/theme/applyColors.d.ts +10 -0
- package/dist/view/theme/applyColors.test.d.ts +1 -0
- package/dist/view/theme/dimensions.d.ts +13 -0
- package/dist/view/theme/dimensions.test.d.ts +1 -0
- package/docs/GAME_DEVELOPER_GUIDE.adoc +167 -0
- package/docs/brick-engine-guide.adoc +87 -0
- package/docs/diagrams/lifecycle.mmd +19 -0
- package/docs/documentation_style_guide.adoc +210 -0
- package/docs/getting-started.adoc +147 -0
- package/docs/images/lifecycle.svg +1 -0
- package/docs/jsdoc_standard.adoc +109 -0
- package/docs/publishing.adoc +58 -0
- package/docs/reference/enums/Color.adoc +35 -0
- package/docs/reference/enums/ControlEventType.adoc +28 -0
- package/docs/reference/enums/ControlKey.adoc +34 -0
- package/docs/reference/enums/FontAlignment.adoc +43 -0
- package/docs/reference/enums/FontSize.adoc +31 -0
- package/docs/reference/enums/Sound.adoc +42 -0
- package/docs/reference/enums/StateProperty.adoc +33 -0
- package/docs/reference/helpers/CellHelper.adoc +37 -0
- package/docs/reference/helpers/ControlInputHandlerHelper.adoc +57 -0
- package/docs/reference/helpers/CoordinateHelper.adoc +118 -0
- package/docs/reference/helpers/RelativeValuesHelper.adoc +53 -0
- package/docs/reference/interfaces/Debuggable.adoc +29 -0
- package/docs/reference/interfaces/GameModules.adoc +35 -0
- package/docs/reference/interfaces/Initializable.adoc +24 -0
- package/docs/reference/interfaces/RendererInitializable.adoc +33 -0
- package/docs/reference/interfaces/StateSyncable.adoc +41 -0
- package/docs/reference/interfaces/modules/Control.adoc +98 -0
- package/docs/reference/interfaces/modules/Grid.adoc +411 -0
- package/docs/reference/interfaces/modules/Renderer.adoc +34 -0
- package/docs/reference/interfaces/modules/RendererComposite.adoc +57 -0
- package/docs/reference/interfaces/modules/Score.adoc +107 -0
- package/docs/reference/interfaces/modules/Session.adoc +66 -0
- package/docs/reference/interfaces/modules/State.adoc +290 -0
- package/docs/reference/interfaces/modules/Text.adoc +110 -0
- package/docs/reference/interfaces/modules/Time.adoc +119 -0
- package/docs/reference/modules/Debugger.adoc +71 -0
- package/docs/reference/modules/DisplayRenderer.adoc +55 -0
- package/docs/reference/modules/Game.adoc +256 -0
- package/docs/reference/modules/GameControl.adoc +139 -0
- package/docs/reference/modules/GameGrid.adoc +794 -0
- package/docs/reference/modules/GameHudGrid.adoc +38 -0
- package/docs/reference/modules/GameMenu.adoc +39 -0
- package/docs/reference/modules/GameRenderer.adoc +79 -0
- package/docs/reference/modules/GameScore.adoc +138 -0
- package/docs/reference/modules/GameSession.adoc +43 -0
- package/docs/reference/modules/GameSound.adoc +111 -0
- package/docs/reference/modules/GameState.adoc +318 -0
- package/docs/reference/modules/GameText.adoc +139 -0
- package/docs/reference/modules/GameTime.adoc +141 -0
- package/docs/reference/modules/HudRenderer.adoc +56 -0
- package/docs/reference/modules/InitialStateSnapshot.adoc +47 -0
- package/docs/reference/modules/SessionModal.adoc +34 -0
- package/docs/reference/types/Axis.adoc +28 -0
- package/docs/reference/types/Cell.adoc +29 -0
- package/docs/reference/types/ControlCallback.adoc +23 -0
- package/docs/reference/types/Coordinate.adoc +29 -0
- package/docs/reference/types/GameEntry.adoc +29 -0
- package/docs/reference/types/GameEvent.adoc +29 -0
- package/docs/reference/types/Piece.adoc +32 -0
- package/docs/reference/types/RendererMetrics.adoc +29 -0
- package/docs/reference/types/Vector.adoc +28 -0
- package/docs/testing_best_practices.adoc +190 -0
- package/eslint.config.mjs +29 -0
- package/package.json +54 -0
- package/public/CNAME +1 -0
- package/public/docs/GAME_DEVELOPER_GUIDE.html +727 -0
- package/public/docs/brick-engine-guide.html +610 -0
- package/public/docs/diagrams/lifecycle.mmd +19 -0
- package/public/docs/documentation_style_guide.html +994 -0
- package/public/docs/getting-started.html +648 -0
- package/public/docs/images/lifecycle.svg +1 -0
- package/public/docs/index.html +593 -0
- package/public/docs/jsdoc_standard.html +656 -0
- package/public/docs/publishing.html +573 -0
- package/public/docs/reference/enums/Color.html +533 -0
- package/public/docs/reference/enums/ControlEventType.html +505 -0
- package/public/docs/reference/enums/ControlKey.html +529 -0
- package/public/docs/reference/enums/FontAlignment.html +545 -0
- package/public/docs/reference/enums/FontSize.html +517 -0
- package/public/docs/reference/enums/Sound.html +558 -0
- package/public/docs/reference/enums/StateProperty.html +525 -0
- package/public/docs/reference/helpers/CellHelper.html +520 -0
- package/public/docs/reference/helpers/ControlInputHandlerHelper.html +569 -0
- package/public/docs/reference/helpers/CoordinateHelper.html +703 -0
- package/public/docs/reference/helpers/RelativeValuesHelper.html +560 -0
- package/public/docs/reference/interfaces/Debuggable.html +501 -0
- package/public/docs/reference/interfaces/GameModules.html +544 -0
- package/public/docs/reference/interfaces/Initializable.html +495 -0
- package/public/docs/reference/interfaces/RendererInitializable.html +517 -0
- package/public/docs/reference/interfaces/StateSyncable.html +542 -0
- package/public/docs/reference/interfaces/modules/Control.html +648 -0
- package/public/docs/reference/interfaces/modules/Grid.html +1256 -0
- package/public/docs/reference/interfaces/modules/Renderer.html +522 -0
- package/public/docs/reference/interfaces/modules/RendererComposite.html +577 -0
- package/public/docs/reference/interfaces/modules/Score.html +669 -0
- package/public/docs/reference/interfaces/modules/Session.html +585 -0
- package/public/docs/reference/interfaces/modules/State.html +897 -0
- package/public/docs/reference/interfaces/modules/Text.html +668 -0
- package/public/docs/reference/interfaces/modules/Time.html +684 -0
- package/public/docs/reference/modules/Debugger.html +579 -0
- package/public/docs/reference/modules/DisplayRenderer.html +557 -0
- package/public/docs/reference/modules/Game.html +909 -0
- package/public/docs/reference/modules/GameControl.html +716 -0
- package/public/docs/reference/modules/GameGrid.html +1910 -0
- package/public/docs/reference/modules/GameHudGrid.html +508 -0
- package/public/docs/reference/modules/GameMenu.html +538 -0
- package/public/docs/reference/modules/GameRenderer.html +589 -0
- package/public/docs/reference/modules/GameScore.html +664 -0
- package/public/docs/reference/modules/GameSession.html +533 -0
- package/public/docs/reference/modules/GameSound.html +636 -0
- package/public/docs/reference/modules/GameState.html +922 -0
- package/public/docs/reference/modules/GameText.html +701 -0
- package/public/docs/reference/modules/GameTime.html +696 -0
- package/public/docs/reference/modules/HudRenderer.html +568 -0
- package/public/docs/reference/modules/InitialStateSnapshot.html +557 -0
- package/public/docs/reference/modules/SessionModal.html +520 -0
- package/public/docs/reference/types/Axis.html +505 -0
- package/public/docs/reference/types/Cell.html +514 -0
- package/public/docs/reference/types/ControlCallback.html +488 -0
- package/public/docs/reference/types/Coordinate.html +510 -0
- package/public/docs/reference/types/GameEntry.html +514 -0
- package/public/docs/reference/types/GameEvent.html +514 -0
- package/public/docs/reference/types/Piece.html +506 -0
- package/public/docs/reference/types/RendererMetrics.html +514 -0
- package/public/docs/reference/types/Vector.html +509 -0
- package/public/docs/testing_best_practices.html +770 -0
- package/public/favicon.ico +0 -0
- package/public/fonts/digital-7.monoitalic.ttf +0 -0
- package/public/images/cell.svg +32 -0
- package/public/images/close.png +0 -0
- package/public/images/games.png +0 -0
- package/public/images/github.png +0 -0
- package/public/images/letter-a.png +0 -0
- package/public/images/letter-d.png +0 -0
- package/public/images/letter-j.png +0 -0
- package/public/images/letter-s.png +0 -0
- package/public/images/letter-w.png +0 -0
- package/public/images/meta-image.png +0 -0
- package/public/images/number-1.png +0 -0
- package/public/images/number-2.png +0 -0
- package/public/images/number-3.png +0 -0
- package/public/images/number-4.png +0 -0
- package/public/images/number-5.png +0 -0
- package/public/images/number-6.png +0 -0
- package/public/images/splash.gif +0 -0
- package/public/index.html +15 -0
- package/public/sounds/sound_00.wav +0 -0
- package/public/sounds/sound_01.wav +0 -0
- package/public/sounds/sound_02.wav +0 -0
- package/public/sounds/sound_03.wav +0 -0
- package/public/sounds/sound_04.wav +0 -0
- package/public/sounds/sound_05.wav +0 -0
- package/public/sounds/sound_06.wav +0 -0
- package/public/sounds/sound_07.wav +0 -0
- package/public/sounds/sound_08.wav +0 -0
- package/public/sounds/sound_09.wav +0 -0
- package/public/sounds/sound_10.wav +0 -0
- package/public/sounds/sound_11.wav +0 -0
- package/public/sounds/sound_12.wav +0 -0
- package/public/sounds/sound_13.wav +0 -0
- package/public/sounds/sound_14.wav +0 -0
- package/public/sounds/sound_15.wav +0 -0
- package/public/style/body.css +86 -0
- package/public/style/buttons.css +233 -0
- package/public/style/debugger.css +117 -0
- package/public/style/sessionModal.css +155 -0
- package/public/style/sourceCodeAndCommands.css +74 -0
- package/public/style/splash.css +13 -0
- package/public/style/theme.css +137 -0
- package/scripts/generate-diagrams.sh +20 -0
- package/scripts/generate-docs.js +111 -0
- package/src/client-game.d.ts +1 -0
- package/src/config/configs.test.ts +20 -0
- package/src/config/configs.ts +197 -0
- package/src/config/env.test.ts +59 -0
- package/src/config/env.ts +7 -0
- package/src/config/styles.ts +5 -0
- package/src/core/Game.test.ts +167 -0
- package/src/core/Game.ts +307 -0
- package/src/core/InitialStateSnapshot.test.ts +51 -0
- package/src/core/InitialStateSnapshot.ts +46 -0
- package/src/core/helpers/CellHelper.test.ts +33 -0
- package/src/core/helpers/CellHelper.ts +21 -0
- package/src/core/helpers/ControlInputHandlerHelper.test.ts +116 -0
- package/src/core/helpers/ControlInputHandlerHelper.ts +68 -0
- package/src/core/helpers/CoordinateHelper.test.ts +113 -0
- package/src/core/helpers/CoordinateHelper.ts +82 -0
- package/src/core/helpers/InterfaceIdentifierHelper.test.ts +122 -0
- package/src/core/helpers/InterfaceIdentifierHelper.ts +43 -0
- package/src/core/helpers/RelativeValuesHelper.test.ts +47 -0
- package/src/core/helpers/RelativeValuesHelper.ts +29 -0
- package/src/core/module/control/GameControl.test.ts +82 -0
- package/src/core/module/control/GameControl.ts +142 -0
- package/src/core/module/control/GameControlKeyBinding.test.ts +59 -0
- package/src/core/module/control/GameControlKeyBinding.ts +92 -0
- package/src/core/module/grid/GameGrid.test.ts +83 -0
- package/src/core/module/grid/GameGrid.ts +610 -0
- package/src/core/module/grid/GameHudGrid.test.ts +22 -0
- package/src/core/module/grid/GameHudGrid.ts +40 -0
- package/src/core/module/grid/engines/GridAnalysisEngine.test.ts +157 -0
- package/src/core/module/grid/engines/GridAnalysisEngine.ts +124 -0
- package/src/core/module/grid/engines/GridLineEngine.test.ts +132 -0
- package/src/core/module/grid/engines/GridLineEngine.ts +165 -0
- package/src/core/module/grid/engines/GridMovementEngine.test.ts +125 -0
- package/src/core/module/grid/engines/GridMovementEngine.ts +113 -0
- package/src/core/module/grid/engines/GridRegionEngine.test.ts +136 -0
- package/src/core/module/grid/engines/GridRegionEngine.ts +52 -0
- package/src/core/module/grid/engines/GridTransformEngine.test.ts +98 -0
- package/src/core/module/grid/engines/GridTransformEngine.ts +70 -0
- package/src/core/module/renderer/DisplayRenderer.test.ts +86 -0
- package/src/core/module/renderer/DisplayRenderer.ts +152 -0
- package/src/core/module/renderer/GameRenderer.test.ts +103 -0
- package/src/core/module/renderer/GameRenderer.ts +144 -0
- package/src/core/module/renderer/HudRenderer.test.ts +108 -0
- package/src/core/module/renderer/HudRenderer.ts +203 -0
- package/src/core/module/score/GameScore.test.ts +71 -0
- package/src/core/module/score/GameScore.ts +188 -0
- package/src/core/module/session/GameSession.test.ts +176 -0
- package/src/core/module/session/GameSession.ts +103 -0
- package/src/core/module/sound/GameSound.test.ts +117 -0
- package/src/core/module/sound/GameSound.ts +229 -0
- package/src/core/module/state/GameState.test.ts +101 -0
- package/src/core/module/state/GameState.ts +339 -0
- package/src/core/module/text/GameText.test.ts +87 -0
- package/src/core/module/text/GameText.ts +150 -0
- package/src/core/module/time/GameTime.test.ts +86 -0
- package/src/core/module/time/GameTime.ts +144 -0
- package/src/core/types/Interfaces.ts +59 -0
- package/src/core/types/Types.ts +124 -0
- package/src/core/types/enums.ts +113 -0
- package/src/core/types/modules.ts +841 -0
- package/src/index.test.ts +15 -0
- package/src/index.ts +9 -0
- package/src/main.test.ts +137 -0
- package/src/main.ts +77 -0
- package/src/menu/GameMenu.test.ts +157 -0
- package/src/menu/GameMenu.ts +124 -0
- package/src/menu/GameMenuSingleton.test.ts +26 -0
- package/src/menu/GameMenuSingleton.ts +13 -0
- package/src/menu/GameRepository.test.ts +46 -0
- package/src/menu/GameRepository.ts +47 -0
- package/src/menu/manager/GameManager.test.ts +68 -0
- package/src/menu/manager/GameManager.ts +50 -0
- package/src/types/global.d.ts +8 -0
- package/src/types/interfaces.ts +5 -0
- package/src/view/Debugger.test.ts +152 -0
- package/src/view/Debugger.ts +124 -0
- package/src/view/GameView.test.ts +95 -0
- package/src/view/GameView.ts +244 -0
- package/src/view/SessionModal.test.ts +141 -0
- package/src/view/SessionModal.ts +73 -0
- package/src/view/components/layout/ButtonLayout.test.ts +28 -0
- package/src/view/components/layout/ButtonLayout.ts +63 -0
- package/src/view/components/layout/ContainerLayout.test.ts +48 -0
- package/src/view/components/layout/ContainerLayout.ts +50 -0
- package/src/view/components/layout/FrameLayout.test.ts +24 -0
- package/src/view/components/layout/FrameLayout.ts +25 -0
- package/src/view/components/ui/BigButton.test.ts +28 -0
- package/src/view/components/ui/BigButton.ts +31 -0
- package/src/view/components/ui/Button.test.ts +30 -0
- package/src/view/components/ui/Button.ts +30 -0
- package/src/view/components/ui/Canvas.test.ts +32 -0
- package/src/view/components/ui/Canvas.ts +34 -0
- package/src/view/components/ui/SmallButton.test.ts +48 -0
- package/src/view/components/ui/SmallButton.ts +32 -0
- package/src/view/theme/applyColors.test.ts +47 -0
- package/src/view/theme/applyColors.ts +38 -0
- package/src/view/theme/dimensions.test.ts +34 -0
- package/src/view/theme/dimensions.ts +53 -0
- package/tsconfig.json +16 -0
- package/vitest.config.ts +14 -0
- package/webpack.config.js +133 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
= RendererInitializable Reference
|
|
2
|
+
:description: Extension of Initializable specifically for rendering components.
|
|
3
|
+
:keywords: rendering, initialization, layout, metrics
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
Extension of `xref:Initializable.adoc[Initializable]` specifically for rendering components.
|
|
16
|
+
|
|
17
|
+
== Methods
|
|
18
|
+
|
|
19
|
+
=== `setup(rendererMetrics: xref:../types/RendererMetrics.adoc[RendererMetrics]): void`
|
|
20
|
+
|
|
21
|
+
Invoked with live geometric metrics for the current session.
|
|
22
|
+
|
|
23
|
+
**Parameters**
|
|
24
|
+
|
|
25
|
+
[cols="1,1,3"]
|
|
26
|
+
|===
|
|
27
|
+
|Name |Type |Description
|
|
28
|
+
|`rendererMetrics` |`xref:../types/RendererMetrics.adoc[RendererMetrics]` |The calculated display dimensions and offsets.
|
|
29
|
+
|===
|
|
30
|
+
|
|
31
|
+
== General Usage
|
|
32
|
+
|
|
33
|
+
Implemented by components like `xref:../modules/DisplayRenderer.adoc[DisplayRenderer]` to receive pre-calculated X/Y origins and cell sizes before the first frame is drawn.
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
= StateSyncable Reference
|
|
2
|
+
:description: Contract for modules that must react to global state changes.
|
|
3
|
+
:keywords: state, reactivity, synchronization, events
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
Contract for modules that must react to global state changes.
|
|
16
|
+
|
|
17
|
+
== Properties
|
|
18
|
+
|
|
19
|
+
[cols="1,1,3"]
|
|
20
|
+
|===
|
|
21
|
+
|Name |Type |Description
|
|
22
|
+
|`_state` |`State` |Internal reference to the state module.
|
|
23
|
+
|===
|
|
24
|
+
|
|
25
|
+
== Methods
|
|
26
|
+
|
|
27
|
+
=== `syncState(state: xref:modules/State.adoc[State]): void`
|
|
28
|
+
|
|
29
|
+
Links the module instance and allows it to subscribe to properties.
|
|
30
|
+
|
|
31
|
+
**Parameters**
|
|
32
|
+
|
|
33
|
+
[cols="1,1,3"]
|
|
34
|
+
|===
|
|
35
|
+
|Name |Type |Description
|
|
36
|
+
|`state` |`xref:modules/State.adoc[State]` |The global state manager.
|
|
37
|
+
|===
|
|
38
|
+
|
|
39
|
+
== General Usage
|
|
40
|
+
|
|
41
|
+
Implemented by `xref:../modules/GameSound.adoc[GameSound]` and `xref:../modules/GameScore.adoc[GameScore]`. During the start-up sequence, the engine calls `syncState()` on these modules to ensure they have the latest references to `muted` flags and `highScore` data.
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
= Control Reference
|
|
2
|
+
:description: Interface for input handling and event-driven control distribution.
|
|
3
|
+
:keywords: control, input, subscription, events
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
Interface for input handling and event-driven control distribution.
|
|
16
|
+
|
|
17
|
+
== Methods
|
|
18
|
+
|
|
19
|
+
=== `notify(key: xref:../../enums/ControlKey.adoc[ControlKey], type: xref:../../enums/ControlEventType.adoc[ControlEventType]): void`
|
|
20
|
+
|
|
21
|
+
Triggers an event manually. Usually called by hardware drivers (like Keyboard listeners).
|
|
22
|
+
|
|
23
|
+
**Parameters**
|
|
24
|
+
|
|
25
|
+
[cols="1,1,3"]
|
|
26
|
+
|===
|
|
27
|
+
|Name |Type |Description
|
|
28
|
+
|`key` |`xref:../../enums/ControlKey.adoc[ControlKey]` |The control key to simulate.
|
|
29
|
+
|`type` |`xref:../../enums/ControlEventType.adoc[ControlEventType]` |The type of event (press/release).
|
|
30
|
+
|===
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
'''
|
|
34
|
+
|
|
35
|
+
=== `setModules(modules: xref:../GameModules.adoc[GameModules]): void`
|
|
36
|
+
|
|
37
|
+
Provides the context registry required for `xref:../../types/GameEvent.adoc[GameEvent]` construction.
|
|
38
|
+
|
|
39
|
+
**Parameters**
|
|
40
|
+
|
|
41
|
+
[cols="1,1,3"]
|
|
42
|
+
|===
|
|
43
|
+
|Name |Type |Description
|
|
44
|
+
|`modules` |`xref:../GameModules.adoc[GameModules]` |Registry of all game modules.
|
|
45
|
+
|===
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
'''
|
|
49
|
+
|
|
50
|
+
=== `subscribe(key: xref:../../enums/ControlKey.adoc[ControlKey], type: xref:../../enums/ControlEventType.adoc[ControlEventType], callback: xref:../../types/ControlCallback.adoc[ControlCallback]): void`
|
|
51
|
+
|
|
52
|
+
Registers a function to be executed when the specified input occurs.
|
|
53
|
+
|
|
54
|
+
**Parameters**
|
|
55
|
+
|
|
56
|
+
[cols="1,1,3"]
|
|
57
|
+
|===
|
|
58
|
+
|Name |Type |Description
|
|
59
|
+
|`key` |`xref:../../enums/ControlKey.adoc[ControlKey]` |The key to listen for.
|
|
60
|
+
|`type` |`xref:../../enums/ControlEventType.adoc[ControlEventType]` |The event type (pressed/held/released).
|
|
61
|
+
|`callback` |`xref:../../types/ControlCallback.adoc[ControlCallback]` |Function to execute when triggered.
|
|
62
|
+
|===
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
'''
|
|
66
|
+
|
|
67
|
+
=== `unsubscribe(key: xref:../../enums/ControlKey.adoc[ControlKey], type: xref:../../enums/ControlEventType.adoc[ControlEventType], callback: xref:../../types/ControlCallback.adoc[ControlCallback]): void`
|
|
68
|
+
|
|
69
|
+
Detaches a previously registered input listener.
|
|
70
|
+
|
|
71
|
+
**Parameters**
|
|
72
|
+
|
|
73
|
+
[cols="1,1,3"]
|
|
74
|
+
|===
|
|
75
|
+
|Name |Type |Description
|
|
76
|
+
|`key` |`xref:../../enums/ControlKey.adoc[ControlKey]` |The key to unsubscribe from.
|
|
77
|
+
|`type` |`xref:../../enums/ControlEventType.adoc[ControlEventType]` |The event type.
|
|
78
|
+
|`callback` |`xref:../../types/ControlCallback.adoc[ControlCallback]` |The specific function to remove.
|
|
79
|
+
|===
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
'''
|
|
83
|
+
|
|
84
|
+
=== `unbindControls(): void`
|
|
85
|
+
|
|
86
|
+
Temporarily disables all input listeners.
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
'''
|
|
90
|
+
|
|
91
|
+
=== `bindControls(): void`
|
|
92
|
+
|
|
93
|
+
Re-enables input listeners.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
== General Usage
|
|
97
|
+
|
|
98
|
+
Implemented by `xref:../../modules/GameControl.adoc[GameControl]`. Games use this to react to player movements (`xref:../../enums/ControlKey.adoc[LEFT]`, `xref:../../enums/ControlKey.adoc[RIGHT]`) or actions (`xref:../../enums/ControlKey.adoc[ACTION]`).
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
= Grid Reference
|
|
2
|
+
:description: Interface defining the behaviors of a 2D grid of cells.
|
|
3
|
+
:keywords: grid, cells, matrix, collision-detection
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
Interface defining the behaviors of a 2D grid of cells.
|
|
16
|
+
|
|
17
|
+
== Properties
|
|
18
|
+
|
|
19
|
+
[cols="1,1,3"]
|
|
20
|
+
|===
|
|
21
|
+
|Name |Type |Description
|
|
22
|
+
|`width` |`number` |The number of columns in the grid.
|
|
23
|
+
|`height` |`number` |The number of rows in the grid.
|
|
24
|
+
|===
|
|
25
|
+
|
|
26
|
+
== Methods
|
|
27
|
+
|
|
28
|
+
=== `getGrid(): xref:../../types/Cell.adoc[Cell][][]`
|
|
29
|
+
|
|
30
|
+
Returns the raw 2D array of `xref:../../types/Cell.adoc[Cell]` objects representing the grid state.
|
|
31
|
+
|
|
32
|
+
**Returns**
|
|
33
|
+
|
|
34
|
+
`xref:../../types/Cell.adoc[Cell][][]` - The matrix representing the grid state.
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
'''
|
|
38
|
+
|
|
39
|
+
=== `resetGrid(): void`
|
|
40
|
+
|
|
41
|
+
Clears all cell values and resets colors to `xref:../../enums/Color.adoc[DEFAULT]`.
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
'''
|
|
45
|
+
|
|
46
|
+
=== `forEach(callback: (cell: xref:../../types/Cell.adoc[Cell]) => void): void`
|
|
47
|
+
|
|
48
|
+
Iterates over every cell in the grid, executing the provided callback.
|
|
49
|
+
|
|
50
|
+
**Parameters**
|
|
51
|
+
|
|
52
|
+
[cols="1,1,3"]
|
|
53
|
+
|===
|
|
54
|
+
|Name |Type |Description
|
|
55
|
+
|`callback` |`(cell: xref:../../types/Cell.adoc[Cell]) => void` |Function to execute for each cell.
|
|
56
|
+
|===
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
'''
|
|
60
|
+
|
|
61
|
+
=== `isValidCoordinate(coordinate: xref:../../types/Coordinate.adoc[Coordinate]): boolean`
|
|
62
|
+
|
|
63
|
+
Returns `true` if the given coordinate falls within the grid boundaries.
|
|
64
|
+
|
|
65
|
+
**Parameters**
|
|
66
|
+
|
|
67
|
+
[cols="1,1,3"]
|
|
68
|
+
|===
|
|
69
|
+
|Name |Type |Description
|
|
70
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |The `{x, y}` point to validate.
|
|
71
|
+
|===
|
|
72
|
+
|
|
73
|
+
**Returns**
|
|
74
|
+
|
|
75
|
+
`boolean` - `true` if valid, `false` otherwise.
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
'''
|
|
79
|
+
|
|
80
|
+
=== `getCell(coordinate: xref:../../types/Coordinate.adoc[Coordinate]): xref:../../types/Cell.adoc[Cell] | null`
|
|
81
|
+
|
|
82
|
+
Retrieves the `xref:../../types/Cell.adoc[Cell]` object at the specified coordinate.
|
|
83
|
+
|
|
84
|
+
**Parameters**
|
|
85
|
+
|
|
86
|
+
[cols="1,1,3"]
|
|
87
|
+
|===
|
|
88
|
+
|Name |Type |Description
|
|
89
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |The `{x, y}` position to query.
|
|
90
|
+
|===
|
|
91
|
+
|
|
92
|
+
**Returns**
|
|
93
|
+
|
|
94
|
+
`xref:../../types/Cell.adoc[Cell] | null` - The cell object, or `null` if the coordinate is out of bounds.
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
'''
|
|
98
|
+
|
|
99
|
+
=== `setCellValue(coordinate: xref:../../types/Coordinate.adoc[Coordinate], value: number): void`
|
|
100
|
+
|
|
101
|
+
Updates the numeric value of the cell at the given coordinate.
|
|
102
|
+
|
|
103
|
+
**Parameters**
|
|
104
|
+
|
|
105
|
+
[cols="1,1,3"]
|
|
106
|
+
|===
|
|
107
|
+
|Name |Type |Description
|
|
108
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Target position.
|
|
109
|
+
|`value` |`number` |New status value (0 for inactive, >0 for active).
|
|
110
|
+
|===
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
'''
|
|
114
|
+
|
|
115
|
+
=== `setCellColor(coordinate: xref:../../types/Coordinate.adoc[Coordinate], color: xref:../../enums/Color.adoc[Color]): void`
|
|
116
|
+
|
|
117
|
+
Updates the visual color of the cell at the given coordinate.
|
|
118
|
+
|
|
119
|
+
**Parameters**
|
|
120
|
+
|
|
121
|
+
[cols="1,1,3"]
|
|
122
|
+
|===
|
|
123
|
+
|Name |Type |Description
|
|
124
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Target position.
|
|
125
|
+
|`color` |`xref:../../enums/Color.adoc[Color]` |Enum value representing the new color.
|
|
126
|
+
|===
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
'''
|
|
130
|
+
|
|
131
|
+
=== `isCellActive(coordinate: xref:../../types/Coordinate.adoc[Coordinate]): boolean`
|
|
132
|
+
|
|
133
|
+
Returns `true` if the cell's value is greater than `0`.
|
|
134
|
+
|
|
135
|
+
**Parameters**
|
|
136
|
+
|
|
137
|
+
[cols="1,1,3"]
|
|
138
|
+
|===
|
|
139
|
+
|Name |Type |Description
|
|
140
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Point to check.
|
|
141
|
+
|===
|
|
142
|
+
|
|
143
|
+
**Returns**
|
|
144
|
+
|
|
145
|
+
`boolean` - `true` if the cell value is greater than 0.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
'''
|
|
149
|
+
|
|
150
|
+
=== `isCellInactive(coordinate: xref:../../types/Coordinate.adoc[Coordinate]): boolean`
|
|
151
|
+
|
|
152
|
+
Returns `true` if the cell's value is `0`.
|
|
153
|
+
|
|
154
|
+
**Parameters**
|
|
155
|
+
|
|
156
|
+
[cols="1,1,3"]
|
|
157
|
+
|===
|
|
158
|
+
|Name |Type |Description
|
|
159
|
+
|`coordinate` |`xref:../../types/Coordinate.adoc[Coordinate]` |Point to check.
|
|
160
|
+
|===
|
|
161
|
+
|
|
162
|
+
**Returns**
|
|
163
|
+
|
|
164
|
+
`boolean` - `true` if the cell value is exactly 0.
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
'''
|
|
168
|
+
|
|
169
|
+
=== `isRowFull(y: number): boolean`
|
|
170
|
+
|
|
171
|
+
Returns `true` if every cell in the specified row `y` is active.
|
|
172
|
+
|
|
173
|
+
**Parameters**
|
|
174
|
+
|
|
175
|
+
[cols="1,1,3"]
|
|
176
|
+
|===
|
|
177
|
+
|Name |Type |Description
|
|
178
|
+
|`y` |`number` |Row index to check.
|
|
179
|
+
|===
|
|
180
|
+
|
|
181
|
+
**Returns**
|
|
182
|
+
|
|
183
|
+
`boolean` - `true` if full.
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
'''
|
|
187
|
+
|
|
188
|
+
=== `isRowEmpty(y: number): boolean`
|
|
189
|
+
|
|
190
|
+
Returns `true` if every cell in the specified row `y` is inactive.
|
|
191
|
+
|
|
192
|
+
**Parameters**
|
|
193
|
+
|
|
194
|
+
[cols="1,1,3"]
|
|
195
|
+
|===
|
|
196
|
+
|Name |Type |Description
|
|
197
|
+
|`y` |`number` |Row index to check.
|
|
198
|
+
|===
|
|
199
|
+
|
|
200
|
+
**Returns**
|
|
201
|
+
|
|
202
|
+
`boolean` - `true` if empty.
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
'''
|
|
206
|
+
|
|
207
|
+
=== `clearRow(y: number): void`
|
|
208
|
+
|
|
209
|
+
Resets all cells in row `y` to their inactive state.
|
|
210
|
+
|
|
211
|
+
**Parameters**
|
|
212
|
+
|
|
213
|
+
[cols="1,1,3"]
|
|
214
|
+
|===
|
|
215
|
+
|Name |Type |Description
|
|
216
|
+
|`y` |`number` |Row index to clear.
|
|
217
|
+
|===
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
'''
|
|
221
|
+
|
|
222
|
+
=== `shiftRowsDown(fromY: number): void`
|
|
223
|
+
|
|
224
|
+
Moves all rows above (and including) `fromY` down by one position.
|
|
225
|
+
|
|
226
|
+
**Parameters**
|
|
227
|
+
|
|
228
|
+
[cols="1,1,3"]
|
|
229
|
+
|===
|
|
230
|
+
|Name |Type |Description
|
|
231
|
+
|`fromY` |`number` |The row index to start shifting from.
|
|
232
|
+
|===
|
|
233
|
+
|
|
234
|
+
|
|
235
|
+
'''
|
|
236
|
+
|
|
237
|
+
=== `shiftRowsUp(fromY: number): void`
|
|
238
|
+
|
|
239
|
+
Moves all rows below (and including) `fromY` up by one position.
|
|
240
|
+
|
|
241
|
+
**Parameters**
|
|
242
|
+
|
|
243
|
+
[cols="1,1,3"]
|
|
244
|
+
|===
|
|
245
|
+
|Name |Type |Description
|
|
246
|
+
|`fromY` |`number` |The row index to start shifting from.
|
|
247
|
+
|===
|
|
248
|
+
|
|
249
|
+
|
|
250
|
+
'''
|
|
251
|
+
|
|
252
|
+
=== `clearFullRows(): number`
|
|
253
|
+
|
|
254
|
+
Detects, clears, and shifts rows for all full rows in the grid.
|
|
255
|
+
|
|
256
|
+
**Returns**
|
|
257
|
+
|
|
258
|
+
`number` - The total count of cleared rows.
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
'''
|
|
262
|
+
|
|
263
|
+
=== `isColumnFull(x: number): boolean`
|
|
264
|
+
|
|
265
|
+
Returns `true` if every cell in column `x` is active.
|
|
266
|
+
|
|
267
|
+
**Parameters**
|
|
268
|
+
|
|
269
|
+
[cols="1,1,3"]
|
|
270
|
+
|===
|
|
271
|
+
|Name |Type |Description
|
|
272
|
+
|`x` |`number` |Column index to check.
|
|
273
|
+
|===
|
|
274
|
+
|
|
275
|
+
**Returns**
|
|
276
|
+
|
|
277
|
+
`boolean` - `true` if full.
|
|
278
|
+
|
|
279
|
+
|
|
280
|
+
'''
|
|
281
|
+
|
|
282
|
+
=== `isColumnEmpty(x: number): boolean`
|
|
283
|
+
|
|
284
|
+
Returns `true` if every cell in column `x` is inactive.
|
|
285
|
+
|
|
286
|
+
**Parameters**
|
|
287
|
+
|
|
288
|
+
[cols="1,1,3"]
|
|
289
|
+
|===
|
|
290
|
+
|Name |Type |Description
|
|
291
|
+
|`x` |`number` |Column index to check.
|
|
292
|
+
|===
|
|
293
|
+
|
|
294
|
+
**Returns**
|
|
295
|
+
|
|
296
|
+
`boolean` - `true` if empty.
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
'''
|
|
300
|
+
|
|
301
|
+
=== `clearColumn(x: number): void`
|
|
302
|
+
|
|
303
|
+
Resets all cells in column `x` to their inactive state.
|
|
304
|
+
|
|
305
|
+
**Parameters**
|
|
306
|
+
|
|
307
|
+
[cols="1,1,3"]
|
|
308
|
+
|===
|
|
309
|
+
|Name |Type |Description
|
|
310
|
+
|`x` |`number` |Column index to clear.
|
|
311
|
+
|===
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
'''
|
|
315
|
+
|
|
316
|
+
=== `shiftColumnsRight(fromX: number): void`
|
|
317
|
+
|
|
318
|
+
Moves all columns to the left of `fromX` one position to the right.
|
|
319
|
+
|
|
320
|
+
**Parameters**
|
|
321
|
+
|
|
322
|
+
[cols="1,1,3"]
|
|
323
|
+
|===
|
|
324
|
+
|Name |Type |Description
|
|
325
|
+
|`fromX` |`number` |The column index to start shifting from.
|
|
326
|
+
|===
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
'''
|
|
330
|
+
|
|
331
|
+
=== `shiftColumnsLeft(fromX: number): void`
|
|
332
|
+
|
|
333
|
+
Moves all columns to the right of `fromX` one position to the left.
|
|
334
|
+
|
|
335
|
+
**Parameters**
|
|
336
|
+
|
|
337
|
+
[cols="1,1,3"]
|
|
338
|
+
|===
|
|
339
|
+
|Name |Type |Description
|
|
340
|
+
|`fromX` |`number` |The column index to start shifting from.
|
|
341
|
+
|===
|
|
342
|
+
|
|
343
|
+
|
|
344
|
+
'''
|
|
345
|
+
|
|
346
|
+
=== `clearFullColumns(): number`
|
|
347
|
+
|
|
348
|
+
Detects and clears all full columns.
|
|
349
|
+
|
|
350
|
+
**Returns**
|
|
351
|
+
|
|
352
|
+
`number` - The total count of cleared columns.
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
'''
|
|
356
|
+
|
|
357
|
+
=== `isAreaOccupied(coordinates: xref:../../types/Coordinate.adoc[Coordinate][]): boolean`
|
|
358
|
+
|
|
359
|
+
Returns `true` if any of the provided coordinates are already active in the grid. Used for collision detection.
|
|
360
|
+
|
|
361
|
+
**Parameters**
|
|
362
|
+
|
|
363
|
+
[cols="1,1,3"]
|
|
364
|
+
|===
|
|
365
|
+
|Name |Type |Description
|
|
366
|
+
|`coordinates` |`xref:../../types/Coordinate.adoc[Coordinate][]` |Array of `{x, y}` points representing a shape or piece.
|
|
367
|
+
|===
|
|
368
|
+
|
|
369
|
+
**Returns**
|
|
370
|
+
|
|
371
|
+
`boolean` - `true` if occupied.
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
'''
|
|
375
|
+
|
|
376
|
+
=== `fillArea(start: xref:../../types/Coordinate.adoc[Coordinate], end: xref:../../types/Coordinate.adoc[Coordinate], value: number, color: xref:../../enums/Color.adoc[Color]): void`
|
|
377
|
+
|
|
378
|
+
Batch updates a rectangular area defined by `start` and `end` with the given value and color.
|
|
379
|
+
|
|
380
|
+
**Parameters**
|
|
381
|
+
|
|
382
|
+
[cols="1,1,3"]
|
|
383
|
+
|===
|
|
384
|
+
|Name |Type |Description
|
|
385
|
+
|`start` |`xref:../../types/Coordinate.adoc[Coordinate]` |Top-left corner of the rectangle.
|
|
386
|
+
|`end` |`xref:../../types/Coordinate.adoc[Coordinate]` |Bottom-right corner of the rectangle.
|
|
387
|
+
|`value` |`number` |Value to apply to all cells in the area.
|
|
388
|
+
|`color` |`xref:../../enums/Color.adoc[Color]` |Color to apply to all cells in the area.
|
|
389
|
+
|===
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
'''
|
|
393
|
+
|
|
394
|
+
=== `stampPiece(coordinates: xref:../../types/Coordinate.adoc[Coordinate][], value: number, color: xref:../../enums/Color.adoc[Color]): void`
|
|
395
|
+
|
|
396
|
+
Applies the specified value and color to multiple discrete coordinates simultaneously.
|
|
397
|
+
|
|
398
|
+
**Parameters**
|
|
399
|
+
|
|
400
|
+
[cols="1,1,3"]
|
|
401
|
+
|===
|
|
402
|
+
|Name |Type |Description
|
|
403
|
+
|`coordinates` |`xref:../../types/Coordinate.adoc[Coordinate][]` |Points to update.
|
|
404
|
+
|`value` |`number` |New cell value.
|
|
405
|
+
|`color` |`xref:../../enums/Color.adoc[Color]` |New cell color.
|
|
406
|
+
|===
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
== General Usage
|
|
410
|
+
|
|
411
|
+
The `Grid` interface is implemented by both the main `xref:../../modules/GameGrid.adoc[GameGrid]` and the `xref:../../modules/GameHudGrid.adoc[GameHudGrid]`.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
= Renderer Reference
|
|
2
|
+
:description: Defines the core drawing contract for engine visual layers.
|
|
3
|
+
:keywords: rendering, drawing, graphics, canvas
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
Defines the core drawing contract for engine visual layers.
|
|
16
|
+
|
|
17
|
+
== Methods
|
|
18
|
+
|
|
19
|
+
=== `render(grid: xref:../../types/Cell.adoc[Cell][][], modules: xref:../GameModules.adoc[GameModules]): void`
|
|
20
|
+
|
|
21
|
+
Executes the drawing logic for a single frame.
|
|
22
|
+
|
|
23
|
+
**Parameters**
|
|
24
|
+
|
|
25
|
+
[cols="1,1,3"]
|
|
26
|
+
|===
|
|
27
|
+
|Name |Type |Description
|
|
28
|
+
|`grid` |`xref:../../types/Cell.adoc[Cell][][]` |The current state of the game grid.
|
|
29
|
+
|`modules` |`xref:../GameModules.adoc[GameModules]` |Registry of all game modules.
|
|
30
|
+
|===
|
|
31
|
+
|
|
32
|
+
== General Usage
|
|
33
|
+
|
|
34
|
+
Implemented by `xref:../../modules/DisplayRenderer.adoc[DisplayRenderer]` and `xref:../../modules/HudRenderer.adoc[HudRenderer]`. The engine's composite renderer iterates through all registered `Renderer` implementations and calls their `render` method 60 times per second.
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
= RendererComposite Reference
|
|
2
|
+
:description: An advanced renderer that manages a collection of individual layers.
|
|
3
|
+
:keywords: renderer, composite, layers, graphics, canvas
|
|
4
|
+
:toc: left
|
|
5
|
+
:toclevels: 3
|
|
6
|
+
:sectnums:
|
|
7
|
+
:sectlinks:
|
|
8
|
+
:icons: font
|
|
9
|
+
:source-highlighter: highlight.js
|
|
10
|
+
:reproducible:
|
|
11
|
+
:experimental:
|
|
12
|
+
:idprefix:
|
|
13
|
+
:idseparator: -
|
|
14
|
+
|
|
15
|
+
An advanced renderer that manages a collection of individual layers.
|
|
16
|
+
|
|
17
|
+
== Properties
|
|
18
|
+
|
|
19
|
+
[cols="1,1,3"]
|
|
20
|
+
|===
|
|
21
|
+
|Name |Type |Description
|
|
22
|
+
|`rendererMetrics` |xref:../../types/RendererMetrics.adoc[RendererMetrics] |The geometric source of truth.
|
|
23
|
+
|===
|
|
24
|
+
|
|
25
|
+
== Methods
|
|
26
|
+
|
|
27
|
+
=== `addRenderer(renderer: xref:Renderer.adoc[Renderer]): void`
|
|
28
|
+
|
|
29
|
+
Attaches a new visual layer.
|
|
30
|
+
|
|
31
|
+
**Parameters**
|
|
32
|
+
|
|
33
|
+
[cols="1,1,3"]
|
|
34
|
+
|===
|
|
35
|
+
|Name |Type |Description
|
|
36
|
+
|`renderer` |`xref:Renderer.adoc[Renderer]` |The renderer instance to add (e.g., Grid, HUD).
|
|
37
|
+
|===
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
'''
|
|
41
|
+
|
|
42
|
+
=== `render(grid: xref:../../types/Cell.adoc[Cell][][], modules: xref:../GameModules.adoc[GameModules]): void`
|
|
43
|
+
|
|
44
|
+
Orchestrates the rendering call for all layers.
|
|
45
|
+
|
|
46
|
+
**Parameters**
|
|
47
|
+
|
|
48
|
+
[cols="1,1,3"]
|
|
49
|
+
|===
|
|
50
|
+
|Name |Type |Description
|
|
51
|
+
|`grid` |`xref:../../types/Cell.adoc[Cell][][]` |The current state of the game grid.
|
|
52
|
+
|`modules` |`xref:../GameModules.adoc[GameModules]` |Registry of all game modules.
|
|
53
|
+
|===
|
|
54
|
+
|
|
55
|
+
== General Usage
|
|
56
|
+
|
|
57
|
+
This interface is the entry point for the visual system. It ensures that the background, the game grid, and the HUD are drawn in the correct order and with synchronized metrics.
|