brick-engine-js 1.0.22 → 1.0.23

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 (98) hide show
  1. package/README.adoc +2 -2
  2. package/dist/docs/index.html +3 -3
  3. package/dist/docs/jsdoc_standard.html +30 -13
  4. package/dist/docs/reference/bootstrap.html +556 -0
  5. package/dist/docs/reference/context/RendererContext.html +19 -9
  6. package/dist/docs/reference/enums/Color.html +11 -5
  7. package/dist/docs/reference/enums/ControlEventType.html +7 -5
  8. package/dist/docs/reference/enums/ControlKey.html +7 -5
  9. package/dist/docs/reference/enums/EventSuffix.html +7 -5
  10. package/dist/docs/reference/enums/FontAlignment.html +9 -7
  11. package/dist/docs/reference/enums/FontSize.html +7 -5
  12. package/dist/docs/reference/enums/Sound.html +7 -5
  13. package/dist/docs/reference/enums/StateProperty.html +7 -5
  14. package/dist/docs/reference/helpers/CellHelper.html +6 -2
  15. package/dist/docs/reference/helpers/ControlInputHandlerHelper.html +9 -5
  16. package/dist/docs/reference/helpers/CoordinateHelper.html +14 -10
  17. package/dist/docs/reference/helpers/RelativeValuesHelper.html +7 -3
  18. package/dist/docs/reference/interfaces/Debuggable.html +9 -7
  19. package/dist/docs/reference/interfaces/GameModules.html +7 -5
  20. package/dist/docs/reference/interfaces/Initializable.html +9 -7
  21. package/dist/docs/reference/interfaces/RendererInitializable.html +9 -7
  22. package/dist/docs/reference/interfaces/StateContext.html +7 -5
  23. package/dist/docs/reference/interfaces/StateSyncable.html +11 -9
  24. package/dist/docs/reference/interfaces/modules/Control.html +19 -17
  25. package/dist/docs/reference/interfaces/modules/Grid.html +77 -55
  26. package/dist/docs/reference/interfaces/modules/Renderer.html +9 -7
  27. package/dist/docs/reference/interfaces/modules/RendererComposite.html +13 -11
  28. package/dist/docs/reference/interfaces/modules/Score.html +21 -19
  29. package/dist/docs/reference/interfaces/modules/Session.html +64 -18
  30. package/dist/docs/reference/interfaces/modules/State.html +59 -57
  31. package/dist/docs/reference/interfaces/modules/Text.html +21 -19
  32. package/dist/docs/reference/interfaces/modules/Time.html +80 -24
  33. package/dist/docs/reference/modules/Debugger.html +16 -14
  34. package/dist/docs/reference/modules/DisplayRenderer.html +10 -8
  35. package/dist/docs/reference/modules/EventEmitter.html +34 -26
  36. package/dist/docs/reference/modules/Game.html +55 -30
  37. package/dist/docs/reference/modules/GameControl.html +49 -44
  38. package/dist/docs/reference/modules/GameEventRegistry.html +17 -34
  39. package/dist/docs/reference/modules/GameGrid.html +174 -116
  40. package/dist/docs/reference/modules/GameHudGrid.html +10 -8
  41. package/dist/docs/reference/modules/GameRenderer.html +14 -12
  42. package/dist/docs/reference/modules/GameScore.html +36 -34
  43. package/dist/docs/reference/modules/GameSession.html +37 -19
  44. package/dist/docs/reference/modules/GameSound.html +20 -18
  45. package/dist/docs/reference/modules/GameState.html +70 -68
  46. package/dist/docs/reference/modules/GameText.html +29 -27
  47. package/dist/docs/reference/modules/GameTime.html +98 -30
  48. package/dist/docs/reference/modules/HudRenderer.html +10 -8
  49. package/dist/docs/reference/modules/InitialStateSnapshot.html +13 -11
  50. package/dist/docs/reference/modules/SessionModal.html +11 -9
  51. package/dist/docs/reference/types/Axis.html +7 -5
  52. package/dist/docs/reference/types/Cell.html +7 -5
  53. package/dist/docs/reference/types/ControlCallback.html +7 -5
  54. package/dist/docs/reference/types/Coordinate.html +7 -5
  55. package/dist/docs/reference/types/GameEvent.html +7 -5
  56. package/dist/docs/reference/types/Piece.html +7 -5
  57. package/dist/docs/reference/types/RendererMetrics.html +7 -5
  58. package/dist/docs/reference/types/Vector.html +7 -5
  59. package/dist/docs/reference/view/GameView.html +29 -21
  60. package/dist/docs/testing_best_practices.html +2 -2
  61. package/dist/game.bundle.js +1 -1
  62. package/dist/types/bootstrap.d.ts +12 -11
  63. package/dist/types/core/Game.d.ts +46 -39
  64. package/dist/types/core/InitialStateSnapshot.d.ts +18 -6
  65. package/dist/types/core/context/RendererContext.d.ts +32 -10
  66. package/dist/types/core/event/EventEmitter.d.ts +64 -21
  67. package/dist/types/core/event/GameEventRegistry.d.ts +17 -3
  68. package/dist/types/core/helpers/CellHelper.d.ts +11 -4
  69. package/dist/types/core/helpers/ControlInputHandlerHelper.d.ts +20 -11
  70. package/dist/types/core/helpers/CoordinateHelper.d.ts +28 -23
  71. package/dist/types/core/helpers/InterfaceIdentifierHelper.d.ts +34 -0
  72. package/dist/types/core/helpers/RelativeValuesHelper.d.ts +10 -8
  73. package/dist/types/core/module/control/GameControl.d.ts +26 -14
  74. package/dist/types/core/module/grid/GameGrid.d.ts +68 -53
  75. package/dist/types/core/module/grid/GameHudGrid.d.ts +9 -7
  76. package/dist/types/core/module/grid/engines/GridAnalysisEngine.d.ts +25 -6
  77. package/dist/types/core/module/grid/engines/GridLineEngine.d.ts +51 -13
  78. package/dist/types/core/module/grid/engines/GridMovementEngine.d.ts +97 -13
  79. package/dist/types/core/module/grid/engines/GridRegionEngine.d.ts +24 -5
  80. package/dist/types/core/module/grid/engines/GridTransformEngine.d.ts +21 -5
  81. package/dist/types/core/module/renderer/DisplayRenderer.d.ts +27 -15
  82. package/dist/types/core/module/renderer/GameRenderer.d.ts +20 -13
  83. package/dist/types/core/module/renderer/HudRenderer.d.ts +27 -19
  84. package/dist/types/core/module/score/GameScore.d.ts +29 -18
  85. package/dist/types/core/module/session/GameSession.d.ts +56 -0
  86. package/dist/types/core/module/sound/GameSound.d.ts +39 -23
  87. package/dist/types/core/module/state/GameState.d.ts +38 -14
  88. package/dist/types/core/module/text/GameText.d.ts +40 -25
  89. package/dist/types/core/module/time/GameTime.d.ts +23 -10
  90. package/dist/types/core/types/Interfaces.d.ts +15 -0
  91. package/dist/types/core/types/Types.d.ts +1 -0
  92. package/dist/types/core/types/enums.d.ts +2 -1
  93. package/dist/types/core/types/modules.d.ts +193 -43
  94. package/dist/types/view/Debugger.d.ts +23 -0
  95. package/dist/types/view/GameView.d.ts +44 -27
  96. package/dist/types/view/SessionModal.d.ts +24 -0
  97. package/package.json +1 -1
  98. package/dist/CNAME +0 -1
@@ -1,10 +1,33 @@
1
1
  import { Initializable } from '../core/types/Interfaces';
2
2
  import { GameModules } from '../core/types/Types';
3
+ /**
4
+ * Specialized DOM overlay for runtime system inspection outside Canvas contexts.
5
+ *
6
+ * Implements the {@link Initializable} lifecycle pattern. Automatically binds
7
+ * to dynamic engine states injecting strictly formatted HTML strings aggregating
8
+ * whatever data active developers pipe through `getDebugData`.
9
+ */
3
10
  export default class NewDebugger implements Initializable {
4
11
  private _gameModules;
5
12
  private _moduleElements;
6
13
  constructor(gameModules: GameModules);
14
+ /**
15
+ * Generates and mounts the initial technical read-outs strictly if `configs` allow it.
16
+ *
17
+ * @returns {void} Returns nothing.
18
+ */
7
19
  setup(): void;
20
+ /**
21
+ * Hotswaps the array of objects queried by the debugging module during execution.
22
+ *
23
+ * @param {GameModules} gameModules - The new collection overriding current tracking configurations.
24
+ * @returns {void} Returns nothing.
25
+ */
8
26
  setGameModules(gameModules: GameModules): void;
27
+ /**
28
+ * Executes the rapid frame translation pasting mapped numbers and string states into browser Text Nodes.
29
+ *
30
+ * @returns {void} Returns nothing.
31
+ */
9
32
  update(): void;
10
33
  }
@@ -2,12 +2,11 @@ import p5 from 'p5';
2
2
  import { Control } from '../core/types/modules';
3
3
  import { GameModules } from '../core/types/Types';
4
4
  /**
5
- * Responsible for rendering the game body and handling control events.
5
+ * Central UI module bridging logical game states to responsive DOM elements.
6
6
  *
7
- * This class acts as the main view controller, orchestrating the layout,
8
- * styles, and user interaction (clicks and holds) for the game.
9
- *
10
- * @class
7
+ * It serves as the single source of truth for the HTML structure, mapping physical user clicks
8
+ * safely down into Engine abstraction events. By orchestrating everything from Canvas instantiation
9
+ * to system Menus, it ensures strictly isolated interactions between the browser window and core logic.
11
10
  */
12
11
  export default class GameView {
13
12
  private _onOffBtn;
@@ -27,15 +26,15 @@ export default class GameView {
27
26
  private _debugger;
28
27
  private _sessionModal;
29
28
  /**
30
- * Creates an instance of GameView.
29
+ * Bootstraps the root listener binding it to a persistent layout container.
31
30
  *
32
- * @param p - The p5 instance used for rendering and event handling.
33
- * @param parent - The DOM element where the game view will be attached.
31
+ * @param {HTMLElement} parent - The DOM element where the game view will be attached.
34
32
  */
35
33
  constructor(parent: HTMLElement);
36
34
  /**
37
- * Checks if the game body has been built.
38
- * @returns True if the game body has been built, false otherwise.
35
+ * Verifies if the physical Canvas context has successfully mounted into the Document structure.
36
+ *
37
+ * @returns {boolean} True if the game body has been built, false otherwise.
39
38
  */
40
39
  isBodyBuilt(): boolean;
41
40
  /**
@@ -54,47 +53,65 @@ export default class GameView {
54
53
  canvasHeight: number;
55
54
  };
56
55
  /**
57
- * Sets up the session modal with the current game modules.
58
- * @param gameModules - The game modules to be used in the session modal.
56
+ * Injects the strictly structured overlay handling interrupted restoration flows.
57
+ *
58
+ * @returns {void} Returns nothing.
59
59
  */
60
60
  setupSessionModal(): void;
61
+ /**
62
+ * Invokes the blocking popup intercepting control until the User forces a choice.
63
+ *
64
+ * @param {function(): void} onConfirm - The mapped execution sequence if the dialog is accepted.
65
+ * @param {function(): void} onCancel - The mapped execution sequence if the dialog is declined.
66
+ * @returns {void} Returns nothing.
67
+ */
61
68
  showSessionModal(onConfirm: () => void, onCancel: () => void): void;
62
69
  /**
63
- * Sets up the debugger with the current game modules.
64
- * @param gameModules - The game modules to be debugged.
70
+ * Instantiates the technical UI diagnostics tool aggregating dynamic execution values into the DOM.
71
+ *
72
+ * @param {GameModules} gameModules - The specific suite of active modules evaluated by pointers.
73
+ * @returns {void} Returns nothing.
65
74
  */
66
75
  setupDebugger(gameModules: GameModules): void;
76
+ /**
77
+ * Points the tracked overlay values dynamically onto a newly injected module configuration suite.
78
+ *
79
+ * @param {GameModules} gameModules - The collection of logically active states swapping contexts.
80
+ * @returns {void} Returns nothing.
81
+ */
67
82
  updateDebuggerGameModules(gameModules: GameModules): void;
68
83
  /**
69
- * Updates the debugger with the current game state.
84
+ * Forces an execution cycle translating the latest internal module variables to the DOM interface.
85
+ *
86
+ * @returns {void} Returns nothing.
70
87
  */
71
88
  updateDebugger(): void;
72
89
  /**
73
- * Binds game control events to the view buttons.
74
- *
75
- * Connects click and hold events from the UI buttons to the game logic controllers.
90
+ * Traps all specific DOM elements mapping pointer and mouse events directly down to engine triggers.
76
91
  *
77
- * @param control - The control module instance.
92
+ * @param {Control} control - The active translation gateway reading raw clicks.
93
+ * @returns {void} Returns nothing.
78
94
  */
79
95
  bindControls(control: Control): void;
80
96
  /**
81
- * Unbinds all events from the view buttons.
97
+ * Safely disengages all listeners destroying pointer mappings across all buttons.
82
98
  *
83
- * Replaces all event listeners with empty functions to prevent interaction
84
- * (e.g., when the game is paused or stopped).
99
+ * @returns {void} Returns nothing.
85
100
  */
86
101
  unbindControls(): void;
87
102
  /**
88
- * Helper method to bind press and release events using ControlInputHandler.
103
+ * Helper injecting standard up/down polling loops directly onto native elements safely.
89
104
  *
90
- * @param btn - The p5 button element to bind.
91
- * @param key - The control key to notify.
105
+ * @param {p5.Element} btn - The specific HTML reference targeted.
106
+ * @param {ControlKey} key - The enumerated alias dispatched downstream on interaction.
107
+ * @returns {void} Returns nothing.
92
108
  */
93
109
  private _bindButtonEvents;
94
110
  /**
95
- * Helper method to hide the splash screen after a delay.
111
+ * Schedules the destructive cleanup sequence fading initialization overlays away gracefully.
96
112
  *
97
- * @param delay - The delay in milliseconds (defaults to `configs.viewLayout.splashHideDelayMs`).
113
+ * @param {number} delay - The specific integer mapped in layout configs.
114
+ * @returns {void} Returns nothing.
98
115
  */
99
116
  private _hideSplash;
100
117
  }
@@ -1,10 +1,34 @@
1
1
  import { Initializable } from '../core/types/Interfaces';
2
+ /**
3
+ * Specialized interrupt overlay confirming persistence restores asynchronously.
4
+ *
5
+ * It generates vanilla DOM elements that intentionally block Canvas execution pointers,
6
+ * preventing game logics from polluting local memory until a Human clearly decides
7
+ * whether to load or destroy auto-saved metadata safely.
8
+ */
2
9
  export default class SessionModal implements Initializable {
3
10
  private _container;
4
11
  private _confirmButton;
5
12
  private _cancelButton;
6
13
  constructor();
14
+ /**
15
+ * Bootstraps the Vanilla DOM creation assigning hidden CSS parameters until execution calls.
16
+ *
17
+ * @returns {void} Returns nothing.
18
+ */
7
19
  setup(): void;
20
+ /**
21
+ * Removes the CSS hidden barrier and binds strictly required callback endpoints to the physical buttons.
22
+ *
23
+ * @param {function(): void} onConfirm - The pointer mapped when the player wants to restore data.
24
+ * @param {function(): void} onCancel - The pointer mapped when the player declines restoration.
25
+ * @returns {void} Returns nothing.
26
+ */
8
27
  show(onConfirm: () => void, onCancel: () => void): void;
28
+ /**
29
+ * Nullifies listeners and applies strictly blocking CSS classes safely.
30
+ *
31
+ * @returns {void} Returns nothing.
32
+ */
9
33
  private _hide;
10
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brick-engine-js",
3
- "version": "1.0.22",
3
+ "version": "1.0.23",
4
4
  "description": "A lightweight brick engine built with p5.js and TypeScript",
5
5
  "type": "commonjs",
6
6
  "main": "dist/brick-engine.js",
package/dist/CNAME DELETED
@@ -1 +0,0 @@
1
- brickengine.com.br