projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Experimental: improve animation, reduce lags in stack moves sending. Add Allmate
[xogo.git]
/
variants
/
Suction
/
class.js
diff --git
a/variants/Suction/class.js
b/variants/Suction/class.js
index
f9cf26d
..
dbaefa0
100644
(file)
--- a/
variants/Suction/class.js
+++ b/
variants/Suction/class.js
@@
-42,8
+42,8
@@
export default class SuctionRules extends ChessRules {
}
genRandInitFen(seed) {
}
genRandInitFen(seed) {
- const
gr = new GiveawayRules(
-
{mode: "suicide", options: this.
options, genFenOnly: true});
+ const
options = Object.assign({mode: "suicide"}, this.options);
+
const gr = new GiveawayRules({options:
options, genFenOnly: true});
// Add empty cmove:
return (
gr.genRandInitFen(seed).slice(0, -17) + '{"enpassant":"-","cmove":"-"}');
// Add empty cmove:
return (
gr.genRandInitFen(seed).slice(0, -17) + '{"enpassant":"-","cmove":"-"}');
@@
-110,4
+110,13
@@
export default class SuctionRules extends ChessRules {
return "*";
}
return "*";
}
+ // Better animation for swaps
+ customAnimate(move, segments, cb) {
+ if (move.vanish.length < 2)
+ return 0;
+ super.animateMoving(move.end, move.start, null,
+ segments.reverse().map(s => s.reverse()), cb);
+ return 1;
+ }
+
};
};