cube-state-engine 1.0.4 → 1.0.5

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.md CHANGED
@@ -4,12 +4,19 @@ A core state manager designed to integrate with custom 3D cube models. This engi
4
4
 
5
5
  ---
6
6
 
7
+ ## Installation
8
+
9
+ npm install cube-state-engine
10
+
11
+ ---
12
+
7
13
  ## Methods
8
14
 
9
15
  | Method | Description | Return Type |
10
16
  | ----------------------------- | -------------------------------------------------------------------------- | ----------- |
11
17
  | `isSolved()` | Checks if the cube is solved. | `boolean` |
12
18
  | `state()` | Returns the current state of the cube as an object representing each face. | `object` |
19
+ | `getMoves(asString: boolean)` | Returns the history of all movements made. | `string` |
13
20
  | `rotateU(clockwise: boolean)` | Rotates the **Upper** face clockwise or counterclockwise. | `void` |
14
21
  | `rotateF(clockwise: boolean)` | Rotates the **Front** face clockwise or counterclockwise. | `void` |
15
22
  | `rotateD(clockwise: boolean)` | Rotates the **Down** face clockwise or counterclockwise. | `void` |
package/dist/index.d.mts CHANGED
@@ -341,7 +341,7 @@ class CubeEngine {
341
341
  * @returns {string|array} The history of movements as an array or string.
342
342
  */
343
343
  getMoves(asString = true) {
344
- return asString ? this.MOVES : this.MOVES.join(" ");
344
+ return asString ? this.MOVES.join(" ") : this.MOVES;
345
345
  }
346
346
  }
347
347
 
package/dist/index.d.ts CHANGED
@@ -341,7 +341,7 @@ class CubeEngine {
341
341
  * @returns {string|array} The history of movements as an array or string.
342
342
  */
343
343
  getMoves(asString = true) {
344
- return asString ? this.MOVES : this.MOVES.join(" ");
344
+ return asString ? this.MOVES.join(" ") : this.MOVES;
345
345
  }
346
346
  }
347
347
 
package/dist/index.js CHANGED
@@ -203,7 +203,7 @@ var CubeEngine = class {
203
203
  * @returns {string|array} The history of movements as an array or string.
204
204
  */
205
205
  getMoves(asString = true) {
206
- return asString ? this.MOVES : this.MOVES.join(" ");
206
+ return asString ? this.MOVES.join(" ") : this.MOVES;
207
207
  }
208
208
  };
209
209
  _CubeEngine_instances = new WeakSet();
package/dist/index.mjs CHANGED
@@ -181,7 +181,7 @@ var CubeEngine = class {
181
181
  * @returns {string|array} The history of movements as an array or string.
182
182
  */
183
183
  getMoves(asString = true) {
184
- return asString ? this.MOVES : this.MOVES.join(" ");
184
+ return asString ? this.MOVES.join(" ") : this.MOVES;
185
185
  }
186
186
  };
187
187
  _CubeEngine_instances = new WeakSet();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cube-state-engine",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "An efficient representation in memory for tracking the Rubik's cube state on each movement.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",