projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Finish Chakart. Debug now
[vchess.git]
/
client
/
src
/
base_rules.js
diff --git
a/client/src/base_rules.js
b/client/src/base_rules.js
index
1795b5f
..
95a90cf
100644
(file)
--- a/
client/src/base_rules.js
+++ b/
client/src/base_rules.js
@@
-80,6
+80,11
@@
export const ChessRules = class ChessRules {
return V.ShowMoves;
}
return V.ShowMoves;
}
+ // Generally true, unless the variant includes random effects
+ static get CorrConfirm() {
+ return true;
+ }
+
// Used for Monochrome variant (TODO: harmonize: !canFlip ==> showFirstTurn)
get showFirstTurn() {
return false;
// Used for Monochrome variant (TODO: harmonize: !canFlip ==> showFirstTurn)
get showFirstTurn() {
return false;
@@
-738,8
+743,7
@@
export const ChessRules = class ChessRules {
if (x2 == lastRank) {
// promotions arg: special override for Hiddenqueen variant
if (!!promotions) finalPieces = promotions;
if (x2 == lastRank) {
// promotions arg: special override for Hiddenqueen variant
if (!!promotions) finalPieces = promotions;
- else if (!!V.PawnSpecs.promotions)
- finalPieces = V.PawnSpecs.promotions;
+ else if (!!V.PawnSpecs.promotions) finalPieces = V.PawnSpecs.promotions;
}
let tr = null;
for (let piece of finalPieces) {
}
let tr = null;
for (let piece of finalPieces) {
@@
-788,10
+792,7
@@
export const ChessRules = class ChessRules {
// Captures
if (V.PawnSpecs.canCapture) {
for (let shiftY of [-1, 1]) {
// Captures
if (V.PawnSpecs.canCapture) {
for (let shiftY of [-1, 1]) {
- if (
- y + shiftY >= 0 &&
- y + shiftY < sizeY
- ) {
+ if (y + shiftY >= 0 && y + shiftY < sizeY) {
if (
this.board[x + shiftX][y + shiftY] != V.EMPTY &&
this.canTake([x, y], [x + shiftX, y + shiftY])
if (
this.board[x + shiftX][y + shiftY] != V.EMPTY &&
this.canTake([x, y], [x + shiftX, y + shiftY])