brick-engine-js 1.0.21 → 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.
- package/README.adoc +2 -2
- package/dist/docs/index.html +3 -3
- package/dist/docs/jsdoc_standard.html +30 -13
- package/dist/docs/reference/bootstrap.html +556 -0
- package/dist/docs/reference/context/RendererContext.html +19 -9
- package/dist/docs/reference/enums/Color.html +11 -5
- package/dist/docs/reference/enums/ControlEventType.html +7 -5
- package/dist/docs/reference/enums/ControlKey.html +7 -5
- package/dist/docs/reference/enums/EventSuffix.html +7 -5
- package/dist/docs/reference/enums/FontAlignment.html +9 -7
- package/dist/docs/reference/enums/FontSize.html +7 -5
- package/dist/docs/reference/enums/Sound.html +7 -5
- package/dist/docs/reference/enums/StateProperty.html +7 -5
- package/dist/docs/reference/helpers/CellHelper.html +6 -2
- package/dist/docs/reference/helpers/ControlInputHandlerHelper.html +9 -5
- package/dist/docs/reference/helpers/CoordinateHelper.html +14 -10
- package/dist/docs/reference/helpers/RelativeValuesHelper.html +7 -3
- package/dist/docs/reference/interfaces/Debuggable.html +9 -7
- package/dist/docs/reference/interfaces/GameModules.html +7 -5
- package/dist/docs/reference/interfaces/Initializable.html +9 -7
- package/dist/docs/reference/interfaces/RendererInitializable.html +9 -7
- package/dist/docs/reference/interfaces/StateContext.html +7 -5
- package/dist/docs/reference/interfaces/StateSyncable.html +11 -9
- package/dist/docs/reference/interfaces/modules/Control.html +19 -17
- package/dist/docs/reference/interfaces/modules/Grid.html +77 -55
- package/dist/docs/reference/interfaces/modules/Renderer.html +9 -7
- package/dist/docs/reference/interfaces/modules/RendererComposite.html +13 -11
- package/dist/docs/reference/interfaces/modules/Score.html +21 -19
- package/dist/docs/reference/interfaces/modules/Session.html +64 -18
- package/dist/docs/reference/interfaces/modules/State.html +59 -57
- package/dist/docs/reference/interfaces/modules/Text.html +21 -19
- package/dist/docs/reference/interfaces/modules/Time.html +80 -24
- package/dist/docs/reference/modules/Debugger.html +16 -14
- package/dist/docs/reference/modules/DisplayRenderer.html +10 -8
- package/dist/docs/reference/modules/EventEmitter.html +34 -26
- package/dist/docs/reference/modules/Game.html +55 -30
- package/dist/docs/reference/modules/GameControl.html +49 -44
- package/dist/docs/reference/modules/GameEventRegistry.html +17 -34
- package/dist/docs/reference/modules/GameGrid.html +174 -116
- package/dist/docs/reference/modules/GameHudGrid.html +10 -8
- package/dist/docs/reference/modules/GameRenderer.html +14 -12
- package/dist/docs/reference/modules/GameScore.html +36 -34
- package/dist/docs/reference/modules/GameSession.html +37 -19
- package/dist/docs/reference/modules/GameSound.html +20 -18
- package/dist/docs/reference/modules/GameState.html +70 -68
- package/dist/docs/reference/modules/GameText.html +29 -27
- package/dist/docs/reference/modules/GameTime.html +98 -30
- package/dist/docs/reference/modules/HudRenderer.html +10 -8
- package/dist/docs/reference/modules/InitialStateSnapshot.html +13 -11
- package/dist/docs/reference/modules/SessionModal.html +11 -9
- package/dist/docs/reference/types/Axis.html +7 -5
- package/dist/docs/reference/types/Cell.html +7 -5
- package/dist/docs/reference/types/ControlCallback.html +7 -5
- package/dist/docs/reference/types/Coordinate.html +7 -5
- package/dist/docs/reference/types/GameEvent.html +7 -5
- package/dist/docs/reference/types/Piece.html +7 -5
- package/dist/docs/reference/types/RendererMetrics.html +7 -5
- package/dist/docs/reference/types/Vector.html +7 -5
- package/dist/docs/reference/view/GameView.html +29 -21
- package/dist/docs/testing_best_practices.html +2 -2
- package/dist/game.bundle.js +1 -1
- package/dist/types/bootstrap.d.ts +12 -11
- package/dist/types/core/Game.d.ts +46 -39
- package/dist/types/core/InitialStateSnapshot.d.ts +18 -6
- package/dist/types/core/context/RendererContext.d.ts +32 -10
- package/dist/types/core/event/EventEmitter.d.ts +64 -21
- package/dist/types/core/event/GameEventRegistry.d.ts +17 -3
- package/dist/types/core/helpers/CellHelper.d.ts +11 -4
- package/dist/types/core/helpers/ControlInputHandlerHelper.d.ts +20 -11
- package/dist/types/core/helpers/CoordinateHelper.d.ts +28 -23
- package/dist/types/core/helpers/InterfaceIdentifierHelper.d.ts +34 -0
- package/dist/types/core/helpers/RelativeValuesHelper.d.ts +10 -8
- package/dist/types/core/module/control/GameControl.d.ts +26 -14
- package/dist/types/core/module/grid/GameGrid.d.ts +92 -53
- package/dist/types/core/module/grid/GameHudGrid.d.ts +9 -7
- package/dist/types/core/module/grid/engines/GridAnalysisEngine.d.ts +25 -6
- package/dist/types/core/module/grid/engines/GridLineEngine.d.ts +51 -13
- package/dist/types/core/module/grid/engines/GridMovementEngine.d.ts +97 -13
- package/dist/types/core/module/grid/engines/GridRegionEngine.d.ts +24 -5
- package/dist/types/core/module/grid/engines/GridTransformEngine.d.ts +21 -5
- package/dist/types/core/module/renderer/DisplayRenderer.d.ts +27 -15
- package/dist/types/core/module/renderer/GameRenderer.d.ts +20 -13
- package/dist/types/core/module/renderer/HudRenderer.d.ts +27 -19
- package/dist/types/core/module/score/GameScore.d.ts +29 -18
- package/dist/types/core/module/session/GameSession.d.ts +56 -0
- package/dist/types/core/module/sound/GameSound.d.ts +39 -23
- package/dist/types/core/module/state/GameState.d.ts +38 -14
- package/dist/types/core/module/text/GameText.d.ts +40 -25
- package/dist/types/core/module/time/GameTime.d.ts +52 -18
- package/dist/types/core/types/Interfaces.d.ts +15 -0
- package/dist/types/core/types/Types.d.ts +1 -0
- package/dist/types/core/types/enums.d.ts +2 -1
- package/dist/types/core/types/modules.d.ts +214 -45
- package/dist/types/view/Debugger.d.ts +23 -0
- package/dist/types/view/GameView.d.ts +44 -27
- package/dist/types/view/SessionModal.d.ts +24 -0
- package/package.json +1 -1
- package/dist/CNAME +0 -1
|
@@ -443,80 +443,85 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
443
443
|
<div id="toc" class="toc2">
|
|
444
444
|
<div id="toctitle">Table of Contents</div>
|
|
445
445
|
<ul class="sectlevel1">
|
|
446
|
-
<li><a href="#
|
|
447
|
-
<li><a href="#
|
|
446
|
+
<li><a href="#architectural-purpose">1. Architectural Purpose</a></li>
|
|
447
|
+
<li><a href="#specialized-instances">2. Specialized Instances</a></li>
|
|
448
|
+
<li><a href="#api-reference">3. API Reference</a>
|
|
448
449
|
<ul class="sectlevel2">
|
|
449
|
-
<li><a href="#core-utilities">
|
|
450
|
+
<li><a href="#core-utilities">3.1. Core & Utilities</a>
|
|
450
451
|
<ul class="sectlevel3">
|
|
451
|
-
<li><a href="#width-number">
|
|
452
|
-
<li><a href="#height-number">
|
|
453
|
-
<li><a href="#
|
|
454
|
-
<li><a href="#
|
|
455
|
-
<li><a href="#
|
|
456
|
-
<li><a href="#
|
|
457
|
-
<li><a href="#
|
|
458
|
-
<li><a href="#
|
|
459
|
-
<li><a href="#
|
|
460
|
-
<li><a href="#
|
|
461
|
-
<li><a href="#
|
|
462
|
-
<li><a href="#
|
|
452
|
+
<li><a href="#width-number">3.1.1. <code>width: number</code></a></li>
|
|
453
|
+
<li><a href="#height-number">3.1.2. <code>height: number</code></a></li>
|
|
454
|
+
<li><a href="#toprow-number">3.1.3. <code>topRow: number</code></a></li>
|
|
455
|
+
<li><a href="#bottomrow-number">3.1.4. <code>bottomRow: number</code></a></li>
|
|
456
|
+
<li><a href="#leftcolumn-number">3.1.5. <code>leftColumn: number</code></a></li>
|
|
457
|
+
<li><a href="#rightcolumn-number">3.1.6. <code>rightColumn: number</code></a></li>
|
|
458
|
+
<li><a href="#resetgrid-void">3.1.7. <code>resetGrid(): void</code></a></li>
|
|
459
|
+
<li><a href="#getgrid-cell">3.1.8. <code>getGrid(): Cell[][]</code></a></li>
|
|
460
|
+
<li><a href="#foreachcallback-cell-cell-void-void">3.1.9. <code>forEach(callback: (cell: Cell) ⇒ void): void</code></a></li>
|
|
461
|
+
<li><a href="#iscoordinatevalidcoordinate-coordinate-boolean">3.1.10. <code>isCoordinateValid(coordinate: Coordinate): boolean</code></a></li>
|
|
462
|
+
<li><a href="#getcellcoordinate-coordinate-cell-null">3.1.11. <code>getCell(coordinate: Coordinate): Cell | null</code></a></li>
|
|
463
|
+
<li><a href="#setcellvaluecoordinate-coordinate-value-number-void">3.1.12. <code>setCellValue(coordinate: Coordinate, value: number): void</code></a></li>
|
|
464
|
+
<li><a href="#setcellcolorcoordinate-coordinate-color-color-void">3.1.13. <code>setCellColor(coordinate: Coordinate, color: Color): void</code></a></li>
|
|
465
|
+
<li><a href="#iscellactivecoordinate-coordinate-boolean">3.1.14. <code>isCellActive(coordinate: Coordinate): boolean</code></a></li>
|
|
466
|
+
<li><a href="#iscellinactivecoordinate-coordinate-boolean">3.1.15. <code>isCellInactive(coordinate: Coordinate): boolean</code></a></li>
|
|
467
|
+
<li><a href="#getdebugdata-recordstring-string-number-boolean">3.1.16. <code>getDebugData(): Record<string, string | number | boolean></code></a></li>
|
|
463
468
|
</ul>
|
|
464
469
|
</li>
|
|
465
|
-
<li><a href="#line-column-management">
|
|
470
|
+
<li><a href="#line-column-management">3.2. Line & Column Management</a>
|
|
466
471
|
<ul class="sectlevel3">
|
|
467
|
-
<li><a href="#isrowfully-number-boolean">
|
|
468
|
-
<li><a href="#isrowemptyy-number-boolean">
|
|
469
|
-
<li><a href="#clearrowy-number-void">
|
|
470
|
-
<li><a href="#shiftrowsdownfromy-number-void">
|
|
471
|
-
<li><a href="#shiftrowsupfromy-number-void">
|
|
472
|
-
<li><a href="#clearfullrows-number">
|
|
473
|
-
<li><a href="#iscolumnfullx-number-boolean">
|
|
474
|
-
<li><a href="#iscolumnemptyx-number-boolean">
|
|
475
|
-
<li><a href="#clearcolumnx-number-void">
|
|
476
|
-
<li><a href="#shiftcolumnsrightfromx-number-void">
|
|
477
|
-
<li><a href="#shiftcolumnsleftfromx-number-void">
|
|
478
|
-
<li><a href="#clearfullcolumns-number">
|
|
472
|
+
<li><a href="#isrowfully-number-boolean">3.2.1. <code>isRowFull(y: number): boolean</code></a></li>
|
|
473
|
+
<li><a href="#isrowemptyy-number-boolean">3.2.2. <code>isRowEmpty(y: number): boolean</code></a></li>
|
|
474
|
+
<li><a href="#clearrowy-number-void">3.2.3. <code>clearRow(y: number): void</code></a></li>
|
|
475
|
+
<li><a href="#shiftrowsdownfromy-number-void">3.2.4. <code>shiftRowsDown(fromY: number): void</code></a></li>
|
|
476
|
+
<li><a href="#shiftrowsupfromy-number-void">3.2.5. <code>shiftRowsUp(fromY: number): void</code></a></li>
|
|
477
|
+
<li><a href="#clearfullrows-number">3.2.6. <code>clearFullRows(): number</code></a></li>
|
|
478
|
+
<li><a href="#iscolumnfullx-number-boolean">3.2.7. <code>isColumnFull(x: number): boolean</code></a></li>
|
|
479
|
+
<li><a href="#iscolumnemptyx-number-boolean">3.2.8. <code>isColumnEmpty(x: number): boolean</code></a></li>
|
|
480
|
+
<li><a href="#clearcolumnx-number-void">3.2.9. <code>clearColumn(x: number): void</code></a></li>
|
|
481
|
+
<li><a href="#shiftcolumnsrightfromx-number-void">3.2.10. <code>shiftColumnsRight(fromX: number): void</code></a></li>
|
|
482
|
+
<li><a href="#shiftcolumnsleftfromx-number-void">3.2.11. <code>shiftColumnsLeft(fromX: number): void</code></a></li>
|
|
483
|
+
<li><a href="#clearfullcolumns-number">3.2.12. <code>clearFullColumns(): number</code></a></li>
|
|
479
484
|
</ul>
|
|
480
485
|
</li>
|
|
481
|
-
<li><a href="#region-area-management">
|
|
486
|
+
<li><a href="#region-area-management">3.3. Region & Area Management</a>
|
|
482
487
|
<ul class="sectlevel3">
|
|
483
|
-
<li><a href="#isareaoccupiedcoordinates-coordinate-boolean">
|
|
484
|
-
<li><a href="#fillareastart-coordinate-end-coordinate-value-number-color-color-void">
|
|
485
|
-
<li><a href="#stamppiecepiece-piece-void">
|
|
486
|
-
<li><a href="#stampcellcell-cell-void">
|
|
488
|
+
<li><a href="#isareaoccupiedcoordinates-coordinate-boolean">3.3.1. <code>isAreaOccupied(coordinates: Coordinate[]): boolean</code></a></li>
|
|
489
|
+
<li><a href="#fillareastart-coordinate-end-coordinate-value-number-color-color-void">3.3.2. <code>fillArea(start: Coordinate, end: Coordinate, value: number, color: Color): void</code></a></li>
|
|
490
|
+
<li><a href="#stamppiecepiece-piece-void">3.3.3. <code>stampPiece(piece: Piece): void</code></a></li>
|
|
491
|
+
<li><a href="#stampcellcell-cell-void">3.3.4. <code>stampCell(cell: Cell): void</code></a></li>
|
|
487
492
|
</ul>
|
|
488
493
|
</li>
|
|
489
|
-
<li><a href="#movement-projections">
|
|
494
|
+
<li><a href="#movement-projections">3.4. Movement & Projections</a>
|
|
490
495
|
<ul class="sectlevel3">
|
|
491
|
-
<li><a href="#movepiecepiece-piece-direction-vector-piece-null">
|
|
492
|
-
<li><a href="#movepieceleftpiece-piece-piece-null">
|
|
493
|
-
<li><a href="#movepiecerightpiece-piece-piece-null">
|
|
494
|
-
<li><a href="#movepieceuppiece-piece-piece-null">
|
|
495
|
-
<li><a href="#movepiecedownpiece-piece-piece-null">
|
|
496
|
-
<li><a href="#movecellcell-cell-direction-vector-cell-null">
|
|
497
|
-
<li><a href="#movecellleftcell-cell-cell-null">
|
|
498
|
-
<li><a href="#movecellrightcell-cell-cell-null">
|
|
499
|
-
<li><a href="#movecellupcell-cell-cell-null">
|
|
500
|
-
<li><a href="#movecelldowncell-cell-cell-null">
|
|
501
|
-
<li><a href="#getdroppathpiece-piece-piece">
|
|
502
|
-
<li><a href="#getrisepathpiece-piece-piece">
|
|
503
|
-
<li><a href="#getreachpathleftpiece-piece-piece">
|
|
504
|
-
<li><a href="#getreachpathrightpiece-piece-piece">
|
|
496
|
+
<li><a href="#movepiecepiece-piece-direction-vector-piece-null">3.4.1. <code>movePiece(piece: Piece, direction: Vector): Piece | null</code></a></li>
|
|
497
|
+
<li><a href="#movepieceleftpiece-piece-piece-null">3.4.2. <code>movePieceLeft(piece: Piece): Piece | null</code></a></li>
|
|
498
|
+
<li><a href="#movepiecerightpiece-piece-piece-null">3.4.3. <code>movePieceRight(piece: Piece): Piece | null</code></a></li>
|
|
499
|
+
<li><a href="#movepieceuppiece-piece-piece-null">3.4.4. <code>movePieceUp(piece: Piece): Piece | null</code></a></li>
|
|
500
|
+
<li><a href="#movepiecedownpiece-piece-piece-null">3.4.5. <code>movePieceDown(piece: Piece): Piece | null</code></a></li>
|
|
501
|
+
<li><a href="#movecellcell-cell-direction-vector-cell-null">3.4.6. <code>moveCell(cell: Cell, direction: Vector): Cell | null</code></a></li>
|
|
502
|
+
<li><a href="#movecellleftcell-cell-cell-null">3.4.7. <code>moveCellLeft(cell: Cell): Cell | null</code></a></li>
|
|
503
|
+
<li><a href="#movecellrightcell-cell-cell-null">3.4.8. <code>moveCellRight(cell: Cell): Cell | null</code></a></li>
|
|
504
|
+
<li><a href="#movecellupcell-cell-cell-null">3.4.9. <code>moveCellUp(cell: Cell): Cell | null</code></a></li>
|
|
505
|
+
<li><a href="#movecelldowncell-cell-cell-null">3.4.10. <code>moveCellDown(cell: Cell): Cell | null</code></a></li>
|
|
506
|
+
<li><a href="#getdroppathpiece-piece-piece">3.4.11. <code>getDropPath(piece: Piece): Piece</code></a></li>
|
|
507
|
+
<li><a href="#getrisepathpiece-piece-piece">3.4.12. <code>getRisePath(piece: Piece): Piece</code></a></li>
|
|
508
|
+
<li><a href="#getreachpathleftpiece-piece-piece">3.4.13. <code>getReachPathLeft(piece: Piece): Piece</code></a></li>
|
|
509
|
+
<li><a href="#getreachpathrightpiece-piece-piece">3.4.14. <code>getReachPathRight(piece: Piece): Piece</code></a></li>
|
|
505
510
|
</ul>
|
|
506
511
|
</li>
|
|
507
|
-
<li><a href="#transformations">
|
|
512
|
+
<li><a href="#transformations">3.5. Transformations</a>
|
|
508
513
|
<ul class="sectlevel3">
|
|
509
|
-
<li><a href="#rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null">
|
|
510
|
-
<li><a href="#mirrorpiecepiece-piece-axis-axis-piece">
|
|
514
|
+
<li><a href="#rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null">3.5.1. <code>rotatePiece(piece: Piece, origin: Coordinate, clockwise: boolean = true): Piece | null</code></a></li>
|
|
515
|
+
<li><a href="#mirrorpiecepiece-piece-axis-axis-piece">3.5.2. <code>mirrorPiece(piece: Piece, axis: Axis): Piece</code></a></li>
|
|
511
516
|
</ul>
|
|
512
517
|
</li>
|
|
513
|
-
<li><a href="#grid-analysis">
|
|
518
|
+
<li><a href="#grid-analysis">3.6. Grid Analysis</a>
|
|
514
519
|
<ul class="sectlevel3">
|
|
515
|
-
<li><a href="#getfullrows-number">
|
|
516
|
-
<li><a href="#getfullcolumns-number">
|
|
517
|
-
<li><a href="#getneighborscoord-coordinate-includediagonal-boolean-false-cell">
|
|
518
|
-
<li><a href="#findconnectedcellscoord-coordinate-piece">
|
|
519
|
-
<li><a href="#swapcellsa-coordinate-b-coordinate-void">
|
|
520
|
+
<li><a href="#getfullrows-number">3.6.1. <code>getFullRows(): number[]</code></a></li>
|
|
521
|
+
<li><a href="#getfullcolumns-number">3.6.2. <code>getFullColumns(): number[]</code></a></li>
|
|
522
|
+
<li><a href="#getneighborscoord-coordinate-includediagonal-boolean-false-cell">3.6.3. <code>getNeighbors(coord: Coordinate, includeDiagonal: boolean = false): Cell[]</code></a></li>
|
|
523
|
+
<li><a href="#findconnectedcellscoord-coordinate-piece">3.6.4. <code>findConnectedCells(coord: Coordinate): Piece</code></a></li>
|
|
524
|
+
<li><a href="#swapcellsa-coordinate-b-coordinate-void">3.6.5. <code>swapCells(a: Coordinate, b: Coordinate): void</code></a></li>
|
|
520
525
|
</ul>
|
|
521
526
|
</li>
|
|
522
527
|
</ul>
|
|
@@ -525,15 +530,16 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
525
530
|
</div>
|
|
526
531
|
</div>
|
|
527
532
|
<div id="content">
|
|
528
|
-
<div
|
|
533
|
+
<div class="sect1">
|
|
534
|
+
<h2 id="architectural-purpose"><a class="link" href="#architectural-purpose">1. Architectural Purpose</a></h2>
|
|
529
535
|
<div class="sectionbody">
|
|
530
536
|
<div class="paragraph">
|
|
531
|
-
<p>The <code>GameGrid</code> module manages the state of a 2D
|
|
537
|
+
<p>The <code>GameGrid</code> module manages the state of a 2D matrix, acting as the authoritative logical boundary. It completely isolates mathematics, mass cell modifications, and overlap checks out from the physical canvas. By standardizing bounds and coordinates, it ensures game states (like pieces falling or rows clearing) calculate deterministically, remaining entirely agnostic to visual scaling logic or frame rates.</p>
|
|
532
538
|
</div>
|
|
533
539
|
</div>
|
|
534
540
|
</div>
|
|
535
541
|
<div class="sect1">
|
|
536
|
-
<h2 id="specialized-instances"><a class="link" href="#specialized-instances">
|
|
542
|
+
<h2 id="specialized-instances"><a class="link" href="#specialized-instances">2. Specialized Instances</a></h2>
|
|
537
543
|
<div class="sectionbody">
|
|
538
544
|
<div class="paragraph">
|
|
539
545
|
<p>The engine provides two main grid instances:
|
|
@@ -543,15 +549,15 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
543
549
|
</div>
|
|
544
550
|
</div>
|
|
545
551
|
<div class="sect1">
|
|
546
|
-
<h2 id="api-reference"><a class="link" href="#api-reference">
|
|
552
|
+
<h2 id="api-reference"><a class="link" href="#api-reference">3. API Reference</a></h2>
|
|
547
553
|
<div class="sectionbody">
|
|
548
554
|
<div class="sect2">
|
|
549
|
-
<h3 id="core-utilities"><a class="link" href="#core-utilities">
|
|
555
|
+
<h3 id="core-utilities"><a class="link" href="#core-utilities">3.1. Core & Utilities</a></h3>
|
|
550
556
|
<div class="paragraph">
|
|
551
557
|
<p>Fundamental methods for grid initialization, basic cell access, and iteration. These methods form the backbone of grid state management.</p>
|
|
552
558
|
</div>
|
|
553
559
|
<div class="sect3">
|
|
554
|
-
<h4 id="width-number"><a class="link" href="#width-number">
|
|
560
|
+
<h4 id="width-number"><a class="link" href="#width-number">3.1.1. <code>width: number</code></a></h4>
|
|
555
561
|
<div class="paragraph">
|
|
556
562
|
<p>Read-only property returning the number of columns in the grid.</p>
|
|
557
563
|
</div>
|
|
@@ -564,7 +570,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
564
570
|
<hr>
|
|
565
571
|
</div>
|
|
566
572
|
<div class="sect3">
|
|
567
|
-
<h4 id="height-number"><a class="link" href="#height-number">
|
|
573
|
+
<h4 id="height-number"><a class="link" href="#height-number">3.1.2. <code>height: number</code></a></h4>
|
|
568
574
|
<div class="paragraph">
|
|
569
575
|
<p>Read-only property returning the number of rows in the grid.</p>
|
|
570
576
|
</div>
|
|
@@ -577,7 +583,59 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
577
583
|
<hr>
|
|
578
584
|
</div>
|
|
579
585
|
<div class="sect3">
|
|
580
|
-
<h4 id="
|
|
586
|
+
<h4 id="toprow-number"><a class="link" href="#toprow-number">3.1.3. <code>topRow: number</code></a></h4>
|
|
587
|
+
<div class="paragraph">
|
|
588
|
+
<p>Read-only property returning the index of the top-most row (always 0).</p>
|
|
589
|
+
</div>
|
|
590
|
+
<div class="paragraph">
|
|
591
|
+
<p><strong>Returns</strong></p>
|
|
592
|
+
</div>
|
|
593
|
+
<div class="paragraph">
|
|
594
|
+
<p><code>number</code> - Top row index.</p>
|
|
595
|
+
</div>
|
|
596
|
+
<hr>
|
|
597
|
+
</div>
|
|
598
|
+
<div class="sect3">
|
|
599
|
+
<h4 id="bottomrow-number"><a class="link" href="#bottomrow-number">3.1.4. <code>bottomRow: number</code></a></h4>
|
|
600
|
+
<div class="paragraph">
|
|
601
|
+
<p>Read-only property returning the index of the bottom-most row.</p>
|
|
602
|
+
</div>
|
|
603
|
+
<div class="paragraph">
|
|
604
|
+
<p><strong>Returns</strong></p>
|
|
605
|
+
</div>
|
|
606
|
+
<div class="paragraph">
|
|
607
|
+
<p><code>number</code> - Bottom row index (<code>height - 1</code>).</p>
|
|
608
|
+
</div>
|
|
609
|
+
<hr>
|
|
610
|
+
</div>
|
|
611
|
+
<div class="sect3">
|
|
612
|
+
<h4 id="leftcolumn-number"><a class="link" href="#leftcolumn-number">3.1.5. <code>leftColumn: number</code></a></h4>
|
|
613
|
+
<div class="paragraph">
|
|
614
|
+
<p>Read-only property returning the index of the left-most column (always 0).</p>
|
|
615
|
+
</div>
|
|
616
|
+
<div class="paragraph">
|
|
617
|
+
<p><strong>Returns</strong></p>
|
|
618
|
+
</div>
|
|
619
|
+
<div class="paragraph">
|
|
620
|
+
<p><code>number</code> - Left column index.</p>
|
|
621
|
+
</div>
|
|
622
|
+
<hr>
|
|
623
|
+
</div>
|
|
624
|
+
<div class="sect3">
|
|
625
|
+
<h4 id="rightcolumn-number"><a class="link" href="#rightcolumn-number">3.1.6. <code>rightColumn: number</code></a></h4>
|
|
626
|
+
<div class="paragraph">
|
|
627
|
+
<p>Read-only property returning the index of the right-most column.</p>
|
|
628
|
+
</div>
|
|
629
|
+
<div class="paragraph">
|
|
630
|
+
<p><strong>Returns</strong></p>
|
|
631
|
+
</div>
|
|
632
|
+
<div class="paragraph">
|
|
633
|
+
<p><code>number</code> - Right column index (<code>width - 1</code>).</p>
|
|
634
|
+
</div>
|
|
635
|
+
<hr>
|
|
636
|
+
</div>
|
|
637
|
+
<div class="sect3">
|
|
638
|
+
<h4 id="resetgrid-void"><a class="link" href="#resetgrid-void">3.1.7. <code>resetGrid(): void</code></a></h4>
|
|
581
639
|
<div class="paragraph">
|
|
582
640
|
<p>Resets the entire grid to its empty state.</p>
|
|
583
641
|
</div>
|
|
@@ -590,7 +648,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
590
648
|
<hr>
|
|
591
649
|
</div>
|
|
592
650
|
<div class="sect3">
|
|
593
|
-
<h4 id="getgrid-cell"><a class="link" href="#getgrid-cell">
|
|
651
|
+
<h4 id="getgrid-cell"><a class="link" href="#getgrid-cell">3.1.8. <code>getGrid(): <a href="../types/Cell.html">Cell</a>[][]</code></a></h4>
|
|
594
652
|
<div class="paragraph">
|
|
595
653
|
<p>Returns the underlying 2D array of cells.</p>
|
|
596
654
|
</div>
|
|
@@ -603,7 +661,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
603
661
|
<hr>
|
|
604
662
|
</div>
|
|
605
663
|
<div class="sect3">
|
|
606
|
-
<h4 id="foreachcallback-cell-cell-void-void"><a class="link" href="#foreachcallback-cell-cell-void-void">
|
|
664
|
+
<h4 id="foreachcallback-cell-cell-void-void"><a class="link" href="#foreachcallback-cell-cell-void-void">3.1.9. <code>forEach(callback: (cell: <a href="../types/Cell.html">Cell</a>) ⇒ void): void</code></a></h4>
|
|
607
665
|
<div class="paragraph">
|
|
608
666
|
<p>Iterates over every cell and executes the provided callback.</p>
|
|
609
667
|
</div>
|
|
@@ -632,7 +690,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
632
690
|
<hr>
|
|
633
691
|
</div>
|
|
634
692
|
<div class="sect3">
|
|
635
|
-
<h4 id="
|
|
693
|
+
<h4 id="iscoordinatevalidcoordinate-coordinate-boolean"><a class="link" href="#iscoordinatevalidcoordinate-coordinate-boolean">3.1.10. <code>isCoordinateValid(coordinate: <a href="../types/Coordinate.html">Coordinate</a>): boolean</code></a></h4>
|
|
636
694
|
<div class="paragraph">
|
|
637
695
|
<p>Verifies if a coordinate is within the current grid boundaries.</p>
|
|
638
696
|
</div>
|
|
@@ -667,7 +725,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
667
725
|
<hr>
|
|
668
726
|
</div>
|
|
669
727
|
<div class="sect3">
|
|
670
|
-
<h4 id="getcellcoordinate-coordinate-cell-null"><a class="link" href="#getcellcoordinate-coordinate-cell-null">
|
|
728
|
+
<h4 id="getcellcoordinate-coordinate-cell-null"><a class="link" href="#getcellcoordinate-coordinate-cell-null">3.1.11. <code>getCell(coordinate: <a href="../types/Coordinate.html">Coordinate</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
671
729
|
<div class="paragraph">
|
|
672
730
|
<p>Retrieves a cell at a specific coordinate.</p>
|
|
673
731
|
</div>
|
|
@@ -702,7 +760,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
702
760
|
<hr>
|
|
703
761
|
</div>
|
|
704
762
|
<div class="sect3">
|
|
705
|
-
<h4 id="setcellvaluecoordinate-coordinate-value-number-void"><a class="link" href="#setcellvaluecoordinate-coordinate-value-number-void">
|
|
763
|
+
<h4 id="setcellvaluecoordinate-coordinate-value-number-void"><a class="link" href="#setcellvaluecoordinate-coordinate-value-number-void">3.1.12. <code>setCellValue(coordinate: <a href="../types/Coordinate.html">Coordinate</a>, value: number): void</code></a></h4>
|
|
706
764
|
<div class="paragraph">
|
|
707
765
|
<p>Updates the numeric value of a cell.</p>
|
|
708
766
|
</div>
|
|
@@ -742,7 +800,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
742
800
|
<hr>
|
|
743
801
|
</div>
|
|
744
802
|
<div class="sect3">
|
|
745
|
-
<h4 id="setcellcolorcoordinate-coordinate-color-color-void"><a class="link" href="#setcellcolorcoordinate-coordinate-color-color-void">
|
|
803
|
+
<h4 id="setcellcolorcoordinate-coordinate-color-color-void"><a class="link" href="#setcellcolorcoordinate-coordinate-color-color-void">3.1.13. <code>setCellColor(coordinate: <a href="../types/Coordinate.html">Coordinate</a>, color: <a href="../enums/Color.html">Color</a>): void</code></a></h4>
|
|
746
804
|
<div class="paragraph">
|
|
747
805
|
<p>Updates the color of a cell.</p>
|
|
748
806
|
</div>
|
|
@@ -776,7 +834,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
776
834
|
<hr>
|
|
777
835
|
</div>
|
|
778
836
|
<div class="sect3">
|
|
779
|
-
<h4 id="iscellactivecoordinate-coordinate-boolean"><a class="link" href="#iscellactivecoordinate-coordinate-boolean">
|
|
837
|
+
<h4 id="iscellactivecoordinate-coordinate-boolean"><a class="link" href="#iscellactivecoordinate-coordinate-boolean">3.1.14. <code>isCellActive(coordinate: <a href="../types/Coordinate.html">Coordinate</a>): boolean</code></a></h4>
|
|
780
838
|
<div class="paragraph">
|
|
781
839
|
<p>Checks if a cell is currently occupied.</p>
|
|
782
840
|
</div>
|
|
@@ -811,7 +869,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
811
869
|
<hr>
|
|
812
870
|
</div>
|
|
813
871
|
<div class="sect3">
|
|
814
|
-
<h4 id="iscellinactivecoordinate-coordinate-boolean"><a class="link" href="#iscellinactivecoordinate-coordinate-boolean">
|
|
872
|
+
<h4 id="iscellinactivecoordinate-coordinate-boolean"><a class="link" href="#iscellinactivecoordinate-coordinate-boolean">3.1.15. <code>isCellInactive(coordinate: <a href="../types/Coordinate.html">Coordinate</a>): boolean</code></a></h4>
|
|
815
873
|
<div class="paragraph">
|
|
816
874
|
<p>Checks if a cell is currently empty.</p>
|
|
817
875
|
</div>
|
|
@@ -846,7 +904,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
846
904
|
<hr>
|
|
847
905
|
</div>
|
|
848
906
|
<div class="sect3">
|
|
849
|
-
<h4 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">
|
|
907
|
+
<h4 id="getdebugdata-recordstring-string-number-boolean"><a class="link" href="#getdebugdata-recordstring-string-number-boolean">3.1.16. <code>getDebugData(): Record<string, string | number | boolean></code></a></h4>
|
|
850
908
|
<div class="paragraph">
|
|
851
909
|
<p>Returns metadata for the real-time debugger.</p>
|
|
852
910
|
</div>
|
|
@@ -860,12 +918,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
860
918
|
</div>
|
|
861
919
|
</div>
|
|
862
920
|
<div class="sect2">
|
|
863
|
-
<h3 id="line-column-management"><a class="link" href="#line-column-management">
|
|
921
|
+
<h3 id="line-column-management"><a class="link" href="#line-column-management">3.2. Line & Column Management</a></h3>
|
|
864
922
|
<div class="paragraph">
|
|
865
923
|
<p>Methods for managing entire lines (rows) or columns. These are essential for mechanics like clearing full lines in Tetris-style games or shifting grid content as a single block.</p>
|
|
866
924
|
</div>
|
|
867
925
|
<div class="sect3">
|
|
868
|
-
<h4 id="isrowfully-number-boolean"><a class="link" href="#isrowfully-number-boolean">
|
|
926
|
+
<h4 id="isrowfully-number-boolean"><a class="link" href="#isrowfully-number-boolean">3.2.1. <code>isRowFull(y: number): boolean</code></a></h4>
|
|
869
927
|
<div class="paragraph">
|
|
870
928
|
<p>Checks if a specific row has no empty cells.</p>
|
|
871
929
|
</div>
|
|
@@ -900,7 +958,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
900
958
|
<hr>
|
|
901
959
|
</div>
|
|
902
960
|
<div class="sect3">
|
|
903
|
-
<h4 id="isrowemptyy-number-boolean"><a class="link" href="#isrowemptyy-number-boolean">
|
|
961
|
+
<h4 id="isrowemptyy-number-boolean"><a class="link" href="#isrowemptyy-number-boolean">3.2.2. <code>isRowEmpty(y: number): boolean</code></a></h4>
|
|
904
962
|
<div class="paragraph">
|
|
905
963
|
<p>Checks if a specific row is completely empty.</p>
|
|
906
964
|
</div>
|
|
@@ -935,7 +993,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
935
993
|
<hr>
|
|
936
994
|
</div>
|
|
937
995
|
<div class="sect3">
|
|
938
|
-
<h4 id="clearrowy-number-void"><a class="link" href="#clearrowy-number-void">
|
|
996
|
+
<h4 id="clearrowy-number-void"><a class="link" href="#clearrowy-number-void">3.2.3. <code>clearRow(y: number): void</code></a></h4>
|
|
939
997
|
<div class="paragraph">
|
|
940
998
|
<p>Resets all cells in a row to the empty state.</p>
|
|
941
999
|
</div>
|
|
@@ -964,7 +1022,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
964
1022
|
<hr>
|
|
965
1023
|
</div>
|
|
966
1024
|
<div class="sect3">
|
|
967
|
-
<h4 id="shiftrowsdownfromy-number-void"><a class="link" href="#shiftrowsdownfromy-number-void">
|
|
1025
|
+
<h4 id="shiftrowsdownfromy-number-void"><a class="link" href="#shiftrowsdownfromy-number-void">3.2.4. <code>shiftRowsDown(fromY: number): void</code></a></h4>
|
|
968
1026
|
<div class="paragraph">
|
|
969
1027
|
<p>Shifts all rows above an index down by one position.</p>
|
|
970
1028
|
</div>
|
|
@@ -999,7 +1057,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
999
1057
|
<hr>
|
|
1000
1058
|
</div>
|
|
1001
1059
|
<div class="sect3">
|
|
1002
|
-
<h4 id="shiftrowsupfromy-number-void"><a class="link" href="#shiftrowsupfromy-number-void">
|
|
1060
|
+
<h4 id="shiftrowsupfromy-number-void"><a class="link" href="#shiftrowsupfromy-number-void">3.2.5. <code>shiftRowsUp(fromY: number): void</code></a></h4>
|
|
1003
1061
|
<div class="paragraph">
|
|
1004
1062
|
<p>Shifts all rows below an index up by one position.</p>
|
|
1005
1063
|
</div>
|
|
@@ -1034,7 +1092,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1034
1092
|
<hr>
|
|
1035
1093
|
</div>
|
|
1036
1094
|
<div class="sect3">
|
|
1037
|
-
<h4 id="clearfullrows-number"><a class="link" href="#clearfullrows-number">
|
|
1095
|
+
<h4 id="clearfullrows-number"><a class="link" href="#clearfullrows-number">3.2.6. <code>clearFullRows(): number</code></a></h4>
|
|
1038
1096
|
<div class="paragraph">
|
|
1039
1097
|
<p>Scans for, clears, and collapses full rows.</p>
|
|
1040
1098
|
</div>
|
|
@@ -1053,7 +1111,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1053
1111
|
<hr>
|
|
1054
1112
|
</div>
|
|
1055
1113
|
<div class="sect3">
|
|
1056
|
-
<h4 id="iscolumnfullx-number-boolean"><a class="link" href="#iscolumnfullx-number-boolean">
|
|
1114
|
+
<h4 id="iscolumnfullx-number-boolean"><a class="link" href="#iscolumnfullx-number-boolean">3.2.7. <code>isColumnFull(x: number): boolean</code></a></h4>
|
|
1057
1115
|
<div class="paragraph">
|
|
1058
1116
|
<p>Checks if a specific column has no empty cells.</p>
|
|
1059
1117
|
</div>
|
|
@@ -1088,7 +1146,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1088
1146
|
<hr>
|
|
1089
1147
|
</div>
|
|
1090
1148
|
<div class="sect3">
|
|
1091
|
-
<h4 id="iscolumnemptyx-number-boolean"><a class="link" href="#iscolumnemptyx-number-boolean">
|
|
1149
|
+
<h4 id="iscolumnemptyx-number-boolean"><a class="link" href="#iscolumnemptyx-number-boolean">3.2.8. <code>isColumnEmpty(x: number): boolean</code></a></h4>
|
|
1092
1150
|
<div class="paragraph">
|
|
1093
1151
|
<p>Checks if a specific column is completely empty.</p>
|
|
1094
1152
|
</div>
|
|
@@ -1123,7 +1181,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1123
1181
|
<hr>
|
|
1124
1182
|
</div>
|
|
1125
1183
|
<div class="sect3">
|
|
1126
|
-
<h4 id="clearcolumnx-number-void"><a class="link" href="#clearcolumnx-number-void">
|
|
1184
|
+
<h4 id="clearcolumnx-number-void"><a class="link" href="#clearcolumnx-number-void">3.2.9. <code>clearColumn(x: number): void</code></a></h4>
|
|
1127
1185
|
<div class="paragraph">
|
|
1128
1186
|
<p>Resets all cells in a column to the empty state.</p>
|
|
1129
1187
|
</div>
|
|
@@ -1152,7 +1210,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1152
1210
|
<hr>
|
|
1153
1211
|
</div>
|
|
1154
1212
|
<div class="sect3">
|
|
1155
|
-
<h4 id="shiftcolumnsrightfromx-number-void"><a class="link" href="#shiftcolumnsrightfromx-number-void">
|
|
1213
|
+
<h4 id="shiftcolumnsrightfromx-number-void"><a class="link" href="#shiftcolumnsrightfromx-number-void">3.2.10. <code>shiftColumnsRight(fromX: number): void</code></a></h4>
|
|
1156
1214
|
<div class="paragraph">
|
|
1157
1215
|
<p>Shifts all columns to the right of an index.</p>
|
|
1158
1216
|
</div>
|
|
@@ -1181,7 +1239,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1181
1239
|
<hr>
|
|
1182
1240
|
</div>
|
|
1183
1241
|
<div class="sect3">
|
|
1184
|
-
<h4 id="shiftcolumnsleftfromx-number-void"><a class="link" href="#shiftcolumnsleftfromx-number-void">
|
|
1242
|
+
<h4 id="shiftcolumnsleftfromx-number-void"><a class="link" href="#shiftcolumnsleftfromx-number-void">3.2.11. <code>shiftColumnsLeft(fromX: number): void</code></a></h4>
|
|
1185
1243
|
<div class="paragraph">
|
|
1186
1244
|
<p>Shifts all columns to the left of an index.</p>
|
|
1187
1245
|
</div>
|
|
@@ -1210,7 +1268,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1210
1268
|
<hr>
|
|
1211
1269
|
</div>
|
|
1212
1270
|
<div class="sect3">
|
|
1213
|
-
<h4 id="clearfullcolumns-number"><a class="link" href="#clearfullcolumns-number">
|
|
1271
|
+
<h4 id="clearfullcolumns-number"><a class="link" href="#clearfullcolumns-number">3.2.12. <code>clearFullColumns(): number</code></a></h4>
|
|
1214
1272
|
<div class="paragraph">
|
|
1215
1273
|
<p>Detects and clears all full columns.</p>
|
|
1216
1274
|
</div>
|
|
@@ -1224,12 +1282,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1224
1282
|
</div>
|
|
1225
1283
|
</div>
|
|
1226
1284
|
<div class="sect2">
|
|
1227
|
-
<h3 id="region-area-management"><a class="link" href="#region-area-management">
|
|
1285
|
+
<h3 id="region-area-management"><a class="link" href="#region-area-management">3.3. Region & Area Management</a></h3>
|
|
1228
1286
|
<div class="paragraph">
|
|
1229
1287
|
<p>Operations for handling multi-cell areas, rectangular regions, and piece shapes. These methods facilitate the logical placement and validation of game objects within the grid.</p>
|
|
1230
1288
|
</div>
|
|
1231
1289
|
<div class="sect3">
|
|
1232
|
-
<h4 id="isareaoccupiedcoordinates-coordinate-boolean"><a class="link" href="#isareaoccupiedcoordinates-coordinate-boolean">
|
|
1290
|
+
<h4 id="isareaoccupiedcoordinates-coordinate-boolean"><a class="link" href="#isareaoccupiedcoordinates-coordinate-boolean">3.3.1. <code>isAreaOccupied(coordinates: <a href="../types/Coordinate.html">Coordinate</a>[]): boolean</code></a></h4>
|
|
1233
1291
|
<div class="paragraph">
|
|
1234
1292
|
<p>Checks for collisions between a list of coordinates and active cells in the grid.</p>
|
|
1235
1293
|
</div>
|
|
@@ -1264,7 +1322,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1264
1322
|
<hr>
|
|
1265
1323
|
</div>
|
|
1266
1324
|
<div class="sect3">
|
|
1267
|
-
<h4 id="fillareastart-coordinate-end-coordinate-value-number-color-color-void"><a class="link" href="#fillareastart-coordinate-end-coordinate-value-number-color-color-void">
|
|
1325
|
+
<h4 id="fillareastart-coordinate-end-coordinate-value-number-color-color-void"><a class="link" href="#fillareastart-coordinate-end-coordinate-value-number-color-color-void">3.3.2. <code>fillArea(start: <a href="../types/Coordinate.html">Coordinate</a>, end: <a href="../types/Coordinate.html">Coordinate</a>, value: number, color: <a href="../enums/Color.html">Color</a>): void</code></a></h4>
|
|
1268
1326
|
<div class="paragraph">
|
|
1269
1327
|
<p>Fills a rectangular area with specified properties.</p>
|
|
1270
1328
|
</div>
|
|
@@ -1308,7 +1366,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1308
1366
|
<hr>
|
|
1309
1367
|
</div>
|
|
1310
1368
|
<div class="sect3">
|
|
1311
|
-
<h4 id="stamppiecepiece-piece-void"><a class="link" href="#stamppiecepiece-piece-void">
|
|
1369
|
+
<h4 id="stamppiecepiece-piece-void"><a class="link" href="#stamppiecepiece-piece-void">3.3.3. <code>stampPiece(piece: <a href="../types/Piece.html">Piece</a>): void</code></a></h4>
|
|
1312
1370
|
<div class="paragraph">
|
|
1313
1371
|
<p>Updates multiple specific coordinates simultaneously with their specific values and colors.</p>
|
|
1314
1372
|
</div>
|
|
@@ -1337,7 +1395,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1337
1395
|
<hr>
|
|
1338
1396
|
</div>
|
|
1339
1397
|
<div class="sect3">
|
|
1340
|
-
<h4 id="stampcellcell-cell-void"><a class="link" href="#stampcellcell-cell-void">
|
|
1398
|
+
<h4 id="stampcellcell-cell-void"><a class="link" href="#stampcellcell-cell-void">3.3.4. <code>stampCell(cell: <a href="../types/Cell.html">Cell</a>): void</code></a></h4>
|
|
1341
1399
|
<div class="paragraph">
|
|
1342
1400
|
<p>Updates a single coordinate with a specific value and color from a Cell.</p>
|
|
1343
1401
|
</div>
|
|
@@ -1367,12 +1425,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1367
1425
|
</div>
|
|
1368
1426
|
</div>
|
|
1369
1427
|
<div class="sect2">
|
|
1370
|
-
<h3 id="movement-projections"><a class="link" href="#movement-projections">
|
|
1428
|
+
<h3 id="movement-projections"><a class="link" href="#movement-projections">3.4. Movement & Projections</a></h3>
|
|
1371
1429
|
<div class="paragraph">
|
|
1372
1430
|
<p>Advanced methods for handling piece and cell movement with built-in collision detection and trajectory prediction.</p>
|
|
1373
1431
|
</div>
|
|
1374
1432
|
<div class="sect3">
|
|
1375
|
-
<h4 id="movepiecepiece-piece-direction-vector-piece-null"><a class="link" href="#movepiecepiece-piece-direction-vector-piece-null">
|
|
1433
|
+
<h4 id="movepiecepiece-piece-direction-vector-piece-null"><a class="link" href="#movepiecepiece-piece-direction-vector-piece-null">3.4.1. <code>movePiece(piece: <a href="../types/Piece.html">Piece</a>, direction: <a href="../types/Vector.html">Vector</a>): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1376
1434
|
<div class="paragraph">
|
|
1377
1435
|
<p>Attempts to shift a collection of cells (a piece) in a specified direction.</p>
|
|
1378
1436
|
</div>
|
|
@@ -1418,35 +1476,35 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1418
1476
|
<hr>
|
|
1419
1477
|
</div>
|
|
1420
1478
|
<div class="sect3">
|
|
1421
|
-
<h4 id="movepieceleftpiece-piece-piece-null"><a class="link" href="#movepieceleftpiece-piece-piece-null">
|
|
1479
|
+
<h4 id="movepieceleftpiece-piece-piece-null"><a class="link" href="#movepieceleftpiece-piece-piece-null">3.4.2. <code>movePieceLeft(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1422
1480
|
<div class="paragraph">
|
|
1423
1481
|
<p>Alias for <code>movePiece</code> shifting one unit to the left.</p>
|
|
1424
1482
|
</div>
|
|
1425
1483
|
<hr>
|
|
1426
1484
|
</div>
|
|
1427
1485
|
<div class="sect3">
|
|
1428
|
-
<h4 id="movepiecerightpiece-piece-piece-null"><a class="link" href="#movepiecerightpiece-piece-piece-null">
|
|
1486
|
+
<h4 id="movepiecerightpiece-piece-piece-null"><a class="link" href="#movepiecerightpiece-piece-piece-null">3.4.3. <code>movePieceRight(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1429
1487
|
<div class="paragraph">
|
|
1430
1488
|
<p>Alias for <code>movePiece</code> shifting one unit to the right.</p>
|
|
1431
1489
|
</div>
|
|
1432
1490
|
<hr>
|
|
1433
1491
|
</div>
|
|
1434
1492
|
<div class="sect3">
|
|
1435
|
-
<h4 id="movepieceuppiece-piece-piece-null"><a class="link" href="#movepieceuppiece-piece-piece-null">
|
|
1493
|
+
<h4 id="movepieceuppiece-piece-piece-null"><a class="link" href="#movepieceuppiece-piece-piece-null">3.4.4. <code>movePieceUp(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1436
1494
|
<div class="paragraph">
|
|
1437
1495
|
<p>Alias for <code>movePiece</code> shifting one unit up.</p>
|
|
1438
1496
|
</div>
|
|
1439
1497
|
<hr>
|
|
1440
1498
|
</div>
|
|
1441
1499
|
<div class="sect3">
|
|
1442
|
-
<h4 id="movepiecedownpiece-piece-piece-null"><a class="link" href="#movepiecedownpiece-piece-piece-null">
|
|
1500
|
+
<h4 id="movepiecedownpiece-piece-piece-null"><a class="link" href="#movepiecedownpiece-piece-piece-null">3.4.5. <code>movePieceDown(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1443
1501
|
<div class="paragraph">
|
|
1444
1502
|
<p>Alias for <code>movePiece</code> shifting one unit down.</p>
|
|
1445
1503
|
</div>
|
|
1446
1504
|
<hr>
|
|
1447
1505
|
</div>
|
|
1448
1506
|
<div class="sect3">
|
|
1449
|
-
<h4 id="movecellcell-cell-direction-vector-cell-null"><a class="link" href="#movecellcell-cell-direction-vector-cell-null">
|
|
1507
|
+
<h4 id="movecellcell-cell-direction-vector-cell-null"><a class="link" href="#movecellcell-cell-direction-vector-cell-null">3.4.6. <code>moveCell(cell: <a href="../types/Cell.html">Cell</a>, direction: <a href="../types/Vector.html">Vector</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
1450
1508
|
<div class="paragraph">
|
|
1451
1509
|
<p>Attempts to shift a single cell in a specified direction.</p>
|
|
1452
1510
|
</div>
|
|
@@ -1492,35 +1550,35 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1492
1550
|
<hr>
|
|
1493
1551
|
</div>
|
|
1494
1552
|
<div class="sect3">
|
|
1495
|
-
<h4 id="movecellleftcell-cell-cell-null"><a class="link" href="#movecellleftcell-cell-cell-null">
|
|
1553
|
+
<h4 id="movecellleftcell-cell-cell-null"><a class="link" href="#movecellleftcell-cell-cell-null">3.4.7. <code>moveCellLeft(cell: <a href="../types/Cell.html">Cell</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
1496
1554
|
<div class="paragraph">
|
|
1497
1555
|
<p>Alias for <code>moveCell</code> shifting one unit to the left.</p>
|
|
1498
1556
|
</div>
|
|
1499
1557
|
<hr>
|
|
1500
1558
|
</div>
|
|
1501
1559
|
<div class="sect3">
|
|
1502
|
-
<h4 id="movecellrightcell-cell-cell-null"><a class="link" href="#movecellrightcell-cell-cell-null">
|
|
1560
|
+
<h4 id="movecellrightcell-cell-cell-null"><a class="link" href="#movecellrightcell-cell-cell-null">3.4.8. <code>moveCellRight(cell: <a href="../types/Cell.html">Cell</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
1503
1561
|
<div class="paragraph">
|
|
1504
1562
|
<p>Alias for <code>moveCell</code> shifting one unit to the right.</p>
|
|
1505
1563
|
</div>
|
|
1506
1564
|
<hr>
|
|
1507
1565
|
</div>
|
|
1508
1566
|
<div class="sect3">
|
|
1509
|
-
<h4 id="movecellupcell-cell-cell-null"><a class="link" href="#movecellupcell-cell-cell-null">
|
|
1567
|
+
<h4 id="movecellupcell-cell-cell-null"><a class="link" href="#movecellupcell-cell-cell-null">3.4.9. <code>moveCellUp(cell: <a href="../types/Cell.html">Cell</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
1510
1568
|
<div class="paragraph">
|
|
1511
1569
|
<p>Alias for <code>moveCell</code> shifting one unit up.</p>
|
|
1512
1570
|
</div>
|
|
1513
1571
|
<hr>
|
|
1514
1572
|
</div>
|
|
1515
1573
|
<div class="sect3">
|
|
1516
|
-
<h4 id="movecelldowncell-cell-cell-null"><a class="link" href="#movecelldowncell-cell-cell-null">
|
|
1574
|
+
<h4 id="movecelldowncell-cell-cell-null"><a class="link" href="#movecelldowncell-cell-cell-null">3.4.10. <code>moveCellDown(cell: <a href="../types/Cell.html">Cell</a>): <a href="../types/Cell.html">Cell</a> | null</code></a></h4>
|
|
1517
1575
|
<div class="paragraph">
|
|
1518
1576
|
<p>Alias for <code>moveCell</code> shifting one unit down.</p>
|
|
1519
1577
|
</div>
|
|
1520
1578
|
<hr>
|
|
1521
1579
|
</div>
|
|
1522
1580
|
<div class="sect3">
|
|
1523
|
-
<h4 id="getdroppathpiece-piece-piece"><a class="link" href="#getdroppathpiece-piece-piece">
|
|
1581
|
+
<h4 id="getdroppathpiece-piece-piece"><a class="link" href="#getdroppathpiece-piece-piece">3.4.11. <code>getDropPath(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1524
1582
|
<div class="paragraph">
|
|
1525
1583
|
<p>Calculates the final vertical resting position of a piece if it were dropped continuously downwards.</p>
|
|
1526
1584
|
</div>
|
|
@@ -1555,7 +1613,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1555
1613
|
<hr>
|
|
1556
1614
|
</div>
|
|
1557
1615
|
<div class="sect3">
|
|
1558
|
-
<h4 id="getrisepathpiece-piece-piece"><a class="link" href="#getrisepathpiece-piece-piece">
|
|
1616
|
+
<h4 id="getrisepathpiece-piece-piece"><a class="link" href="#getrisepathpiece-piece-piece">3.4.12. <code>getRisePath(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1559
1617
|
<div class="paragraph">
|
|
1560
1618
|
<p>Calculates the final vertical resting position of a piece if it were moved continuously upwards.</p>
|
|
1561
1619
|
</div>
|
|
@@ -1590,7 +1648,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1590
1648
|
<hr>
|
|
1591
1649
|
</div>
|
|
1592
1650
|
<div class="sect3">
|
|
1593
|
-
<h4 id="getreachpathleftpiece-piece-piece"><a class="link" href="#getreachpathleftpiece-piece-piece">
|
|
1651
|
+
<h4 id="getreachpathleftpiece-piece-piece"><a class="link" href="#getreachpathleftpiece-piece-piece">3.4.13. <code>getReachPathLeft(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1594
1652
|
<div class="paragraph">
|
|
1595
1653
|
<p>Calculates the final horizontal resting position of a piece if it were moved continuously to the left.</p>
|
|
1596
1654
|
</div>
|
|
@@ -1625,7 +1683,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1625
1683
|
<hr>
|
|
1626
1684
|
</div>
|
|
1627
1685
|
<div class="sect3">
|
|
1628
|
-
<h4 id="getreachpathrightpiece-piece-piece"><a class="link" href="#getreachpathrightpiece-piece-piece">
|
|
1686
|
+
<h4 id="getreachpathrightpiece-piece-piece"><a class="link" href="#getreachpathrightpiece-piece-piece">3.4.14. <code>getReachPathRight(piece: <a href="../types/Piece.html">Piece</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1629
1687
|
<div class="paragraph">
|
|
1630
1688
|
<p>Calculates the final horizontal resting position of a piece if it were moved continuously to the right.</p>
|
|
1631
1689
|
</div>
|
|
@@ -1661,12 +1719,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1661
1719
|
</div>
|
|
1662
1720
|
</div>
|
|
1663
1721
|
<div class="sect2">
|
|
1664
|
-
<h3 id="transformations"><a class="link" href="#transformations">
|
|
1722
|
+
<h3 id="transformations"><a class="link" href="#transformations">3.5. Transformations</a></h3>
|
|
1665
1723
|
<div class="paragraph">
|
|
1666
1724
|
<p>Geometric operations for rotating or mirroring complex shapes within the grid boundaries.</p>
|
|
1667
1725
|
</div>
|
|
1668
1726
|
<div class="sect3">
|
|
1669
|
-
<h4 id="rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null"><a class="link" href="#rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null">
|
|
1727
|
+
<h4 id="rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null"><a class="link" href="#rotatepiecepiece-piece-origin-coordinate-clockwise-boolean-true-piece-null">3.5.1. <code>rotatePiece(piece: <a href="../types/Piece.html">Piece</a>, origin: <a href="../types/Coordinate.html">Coordinate</a>, clockwise: boolean = true): <a href="../types/Piece.html">Piece</a> | null</code></a></h4>
|
|
1670
1728
|
<div class="paragraph">
|
|
1671
1729
|
<p>Attempts to rotate a collection of cells 90 degrees around a specific origin point.</p>
|
|
1672
1730
|
</div>
|
|
@@ -1711,7 +1769,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1711
1769
|
<hr>
|
|
1712
1770
|
</div>
|
|
1713
1771
|
<div class="sect3">
|
|
1714
|
-
<h4 id="mirrorpiecepiece-piece-axis-axis-piece"><a class="link" href="#mirrorpiecepiece-piece-axis-axis-piece">
|
|
1772
|
+
<h4 id="mirrorpiecepiece-piece-axis-axis-piece"><a class="link" href="#mirrorpiecepiece-piece-axis-axis-piece">3.5.2. <code>mirrorPiece(piece: <a href="../types/Piece.html">Piece</a>, axis: <a href="../types/Axis.html">Axis</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1715
1773
|
<div class="paragraph">
|
|
1716
1774
|
<p>Mirrors a piece across its own center on a specific axis.</p>
|
|
1717
1775
|
</div>
|
|
@@ -1752,12 +1810,12 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1752
1810
|
</div>
|
|
1753
1811
|
</div>
|
|
1754
1812
|
<div class="sect2">
|
|
1755
|
-
<h3 id="grid-analysis"><a class="link" href="#grid-analysis">
|
|
1813
|
+
<h3 id="grid-analysis"><a class="link" href="#grid-analysis">3.6. Grid Analysis</a></h3>
|
|
1756
1814
|
<div class="paragraph">
|
|
1757
1815
|
<p>Methods for inspecting grid state, finding patterns, and performing searches over the active cell data.</p>
|
|
1758
1816
|
</div>
|
|
1759
1817
|
<div class="sect3">
|
|
1760
|
-
<h4 id="getfullrows-number"><a class="link" href="#getfullrows-number">
|
|
1818
|
+
<h4 id="getfullrows-number"><a class="link" href="#getfullrows-number">3.6.1. <code>getFullRows(): number[]</code></a></h4>
|
|
1761
1819
|
<div class="paragraph">
|
|
1762
1820
|
<p>Identifies all rows that are completely filled with active cells.</p>
|
|
1763
1821
|
</div>
|
|
@@ -1770,7 +1828,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1770
1828
|
<hr>
|
|
1771
1829
|
</div>
|
|
1772
1830
|
<div class="sect3">
|
|
1773
|
-
<h4 id="getfullcolumns-number"><a class="link" href="#getfullcolumns-number">
|
|
1831
|
+
<h4 id="getfullcolumns-number"><a class="link" href="#getfullcolumns-number">3.6.2. <code>getFullColumns(): number[]</code></a></h4>
|
|
1774
1832
|
<div class="paragraph">
|
|
1775
1833
|
<p>Identifies all columns that are completely filled with active cells.</p>
|
|
1776
1834
|
</div>
|
|
@@ -1783,7 +1841,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1783
1841
|
<hr>
|
|
1784
1842
|
</div>
|
|
1785
1843
|
<div class="sect3">
|
|
1786
|
-
<h4 id="getneighborscoord-coordinate-includediagonal-boolean-false-cell"><a class="link" href="#getneighborscoord-coordinate-includediagonal-boolean-false-cell">
|
|
1844
|
+
<h4 id="getneighborscoord-coordinate-includediagonal-boolean-false-cell"><a class="link" href="#getneighborscoord-coordinate-includediagonal-boolean-false-cell">3.6.3. <code>getNeighbors(coord: <a href="../types/Coordinate.html">Coordinate</a>, includeDiagonal: boolean = false): <a href="../types/Cell.html">Cell</a>[]</code></a></h4>
|
|
1787
1845
|
<div class="paragraph">
|
|
1788
1846
|
<p>Returns all active cells adjacent to a specific coordinate.</p>
|
|
1789
1847
|
</div>
|
|
@@ -1823,7 +1881,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1823
1881
|
<hr>
|
|
1824
1882
|
</div>
|
|
1825
1883
|
<div class="sect3">
|
|
1826
|
-
<h4 id="findconnectedcellscoord-coordinate-piece"><a class="link" href="#findconnectedcellscoord-coordinate-piece">
|
|
1884
|
+
<h4 id="findconnectedcellscoord-coordinate-piece"><a class="link" href="#findconnectedcellscoord-coordinate-piece">3.6.4. <code>findConnectedCells(coord: <a href="../types/Coordinate.html">Coordinate</a>): <a href="../types/Piece.html">Piece</a></code></a></h4>
|
|
1827
1885
|
<div class="paragraph">
|
|
1828
1886
|
<p>Finds all connected active cells of the same value starting from a specific coordinate using a Breadth-First Search (BFS) algorithm.</p>
|
|
1829
1887
|
</div>
|
|
@@ -1858,7 +1916,7 @@ body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-b
|
|
|
1858
1916
|
<hr>
|
|
1859
1917
|
</div>
|
|
1860
1918
|
<div class="sect3">
|
|
1861
|
-
<h4 id="swapcellsa-coordinate-b-coordinate-void"><a class="link" href="#swapcellsa-coordinate-b-coordinate-void">
|
|
1919
|
+
<h4 id="swapcellsa-coordinate-b-coordinate-void"><a class="link" href="#swapcellsa-coordinate-b-coordinate-void">3.6.5. <code>swapCells(a: <a href="../types/Coordinate.html">Coordinate</a>, b: <a href="../types/Coordinate.html">Coordinate</a>): void</code></a></h4>
|
|
1862
1920
|
<div class="paragraph">
|
|
1863
1921
|
<p>Swaps the values and colors of two specified cells on the grid.</p>
|
|
1864
1922
|
</div>
|