projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Start server implementation for correspondance play (early debug stage)
[vchess.git]
/
public
/
javascripts
/
variants
/
Checkered.js
diff --git
a/public/javascripts/variants/Checkered.js
b/public/javascripts/variants/Checkered.js
index
eee21b8
..
9de46ff
100644
(file)
--- a/
public/javascripts/variants/Checkered.js
+++ b/
public/javascripts/variants/Checkered.js
@@
-181,15
+181,15
@@
class CheckeredRules extends ChessRules
underCheck(color)
{
underCheck(color)
{
- return this.isAttacked(this.kingPos[color], [
this.g
etOppCol(color),'c']);
+ return this.isAttacked(this.kingPos[color], [
V.G
etOppCol(color),'c']);
}
getCheckSquares(color)
{
// Artifically change turn, for checkered pawns
}
getCheckSquares(color)
{
// Artifically change turn, for checkered pawns
- this.turn =
this.g
etOppCol(color);
+ this.turn =
V.G
etOppCol(color);
const kingAttacked = this.isAttacked(
const kingAttacked = this.isAttacked(
- this.kingPos[color], [
this.g
etOppCol(color),'c']);
+ this.kingPos[color], [
V.G
etOppCol(color),'c']);
let res = kingAttacked
? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate!
: [];
let res = kingAttacked
? [JSON.parse(JSON.stringify(this.kingPos[color]))] //need to duplicate!
: [];
@@
-210,11
+210,11
@@
class CheckeredRules extends ChessRules
{
const color = this.turn;
// Artifically change turn, for checkered pawns
{
const color = this.turn;
// Artifically change turn, for checkered pawns
- this.turn =
this.g
etOppCol(this.turn);
- const res = this.isAttacked(this.kingPos[color], [
this.g
etOppCol(color),'c'])
+ this.turn =
V.G
etOppCol(this.turn);
+ const res = this.isAttacked(this.kingPos[color], [
V.G
etOppCol(color),'c'])
? (color == "w" ? "0-1" : "1-0")
: "1/2";
? (color == "w" ? "0-1" : "1-0")
: "1/2";
- this.turn =
this.g
etOppCol(this.turn);
+ this.turn =
V.G
etOppCol(this.turn);
return res;
}
return res;
}
@@
-278,7
+278,7
@@
class CheckeredRules extends ChessRules
if (move.vanish.length > 1)
{
// Capture
if (move.vanish.length > 1)
{
// Capture
- const startColumn = V.
Get
Column(move.start.y);
+ const startColumn = V.
CoordTo
Column(move.start.y);
notation = startColumn + "x" + finalSquare +
"=" + move.appear[0].p.toUpperCase();
}
notation = startColumn + "x" + finalSquare +
"=" + move.appear[0].p.toUpperCase();
}
@@
-299,5
+299,3
@@
class CheckeredRules extends ChessRules
}
}
}
}
}
}
-
-const VariantRules = CheckeredRules;