projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Janggi Spanish translation
[vchess.git]
/
client
/
src
/
variants
/
Dynamo.js
diff --git
a/client/src/variants/Dynamo.js
b/client/src/variants/Dynamo.js
index
cdb02c6
..
35c41c5
100644
(file)
--- a/
client/src/variants/Dynamo.js
+++ b/
client/src/variants/Dynamo.js
@@
-2,6
+2,7
@@
import { ChessRules, Move, PiPo } from "@/base_rules";
import { randInt } from "@/utils/alea";
export class DynamoRules extends ChessRules {
import { randInt } from "@/utils/alea";
export class DynamoRules extends ChessRules {
+
// TODO? later, allow to push out pawns on a and h files
static get HasEnpassant() {
return false;
// TODO? later, allow to push out pawns on a and h files
static get HasEnpassant() {
return false;
@@
-738,13
+739,6
@@
export class DynamoRules extends ChessRules {
return potentialMoves;
}
return potentialMoves;
}
- getCurrentScore() {
- if (this.subTurn == 2)
- // Move not over
- return "*";
- return super.getCurrentScore();
- }
-
doClick(square) {
// A click to promote a piece on subTurn 2 would trigger this.
// For now it would then return [NaN, NaN] because surrounding squares
doClick(square) {
// A click to promote a piece on subTurn 2 would trigger this.
// For now it would then return [NaN, NaN] because surrounding squares
@@
-773,6
+767,8
@@
export class DynamoRules extends ChessRules {
play(move) {
move.flags = JSON.stringify(this.aggregateFlags());
V.PlayOnBoard(this.board, move);
play(move) {
move.flags = JSON.stringify(this.aggregateFlags());
V.PlayOnBoard(this.board, move);
+ // NOTE; if subTurn == 1, there may be no available moves at subTurn == 2.
+ // However, it's quite easier to wait for a user click.
if (this.subTurn == 2) {
const L = this.firstMove.length;
this.amoves.push(this.getAmove(this.firstMove[L-1], move));
if (this.subTurn == 2) {
const L = this.firstMove.length;
this.amoves.push(this.getAmove(this.firstMove[L-1], move));
@@
-880,4
+876,5
@@
export class DynamoRules extends ChessRules {
return initialSquare + "R";
return move.appear[0].p.toUpperCase() + initialSquare + finalSquare;
}
return initialSquare + "R";
return move.appear[0].p.toUpperCase() + initialSquare + finalSquare;
}
+
};
};