cm-chess 3.4.0 → 3.4.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/package.json +1 -1
- package/src/Chess.js +3 -2
package/package.json
CHANGED
package/src/Chess.js
CHANGED
|
@@ -327,9 +327,10 @@ export class Chess {
|
|
|
327
327
|
}
|
|
328
328
|
|
|
329
329
|
/**
|
|
330
|
+
* @param move
|
|
330
331
|
* @returns {string} "b" or "w" the color to move in the main variation
|
|
331
332
|
*/
|
|
332
|
-
turn() {
|
|
333
|
+
turn(move = this.lastMove()) {
|
|
333
334
|
let factor = 0
|
|
334
335
|
if (this.setUpFen()) {
|
|
335
336
|
const fenParts = this.setUpFen().split(" ")
|
|
@@ -337,7 +338,7 @@ export class Chess {
|
|
|
337
338
|
factor = 1
|
|
338
339
|
}
|
|
339
340
|
}
|
|
340
|
-
return (
|
|
341
|
+
return (move.ply) % 2 === factor ? COLOR.white : COLOR.black
|
|
341
342
|
}
|
|
342
343
|
|
|
343
344
|
/**
|