projects
/
vchess.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add a few questions...
[vchess.git]
/
public
/
javascripts
/
variants
/
Antiking.js
diff --git
a/public/javascripts/variants/Antiking.js
b/public/javascripts/variants/Antiking.js
index
ddfd967
..
ac25c73
100644
(file)
--- a/
public/javascripts/variants/Antiking.js
+++ b/
public/javascripts/variants/Antiking.js
@@
-8,10
+8,10
@@
class AntikingRules
static get ANTIKING() { return 'a'; }
static get ANTIKING() { return 'a'; }
- // TODO: more subtle than that, require changing args: wp, bk and not just colors
- canTake(color1, color2)
+ canTake(color1, color2, [x,y])
{
{
- return color1 != color2;
+ const piece = this.getPiece(x,y);
+ return (piece != "a" && color1 != color2) || (piece == "a" && color1 == color2);
}
getPotentialMovesFrom([x,y])
}
getPotentialMovesFrom([x,y])
@@
-26,6
+26,8
@@
class AntikingRules
}
}
}
}
+// TODO: generaliser (à moindre coût) base_rules ? Ou spécialiser variantes ?
+
getPotentialAntikingMoves(x, y, c)
{
// TODO
getPotentialAntikingMoves(x, y, c)
{
// TODO