+ // En-passant captures need a stack of squares:
+ static get HasEnpassant() {
+ return true;
+ }
+
+ // Some variants cannot have analyse mode
+ static get CanAnalyze() {
+ return true;
+ }
+ // Patch: issues with javascript OOP, objects can't access static fields.
+ get canAnalyze() {
+ return V.CanAnalyze;
+ }
+
+ // Some variants show incomplete information,
+ // and thus show only a partial moves list or no list at all.
+ static get ShowMoves() {
+ return "all";
+ }
+ get showMoves() {
+ return V.ShowMoves;
+ }
+
+ // Sometimes moves must remain hidden until game ends
+ static get SomeHiddenMoves() {
+ return false;
+ }
+ get someHiddenMoves() {
+ return V.SomeHiddenMoves;
+ }
+
+ // 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;
+ }
+
+ // Some variants always show the same orientation
+ static get CanFlip() {
+ return true;
+ }
+ get canFlip() {
+ return V.CanFlip;
+ }
+
+ // NOTE: these will disappear once each variant has its dedicated SVG board.
+ // For (generally old) variants without checkered board
+ static get Monochrome() {
+ return false;
+ }
+ // Some games are drawn unusually (bottom right corner is black)
+ static get DarkBottomRight() {
+ return false;
+ }
+ // Some variants require lines drawing
+ static get Lines() {
+ if (V.Monochrome) {
+ let lines = [];
+ // Draw all inter-squares lines
+ for (let i = 0; i <= V.size.x; i++)
+ lines.push([[i, 0], [i, V.size.y]]);
+ for (let j = 0; j <= V.size.y; j++)
+ lines.push([[0, j], [V.size.x, j]]);
+ return lines;
+ }
+ return null;
+ }
+
+ // In some variants, the player who repeat a position loses
+ static get LoseOnRepetition() {
+ return false;
+ }
+ // And in some others (Iceage), repetitions should be ignored:
+ static get IgnoreRepetition() {
+ return false;
+ }
+ loseOnRepetition() {
+ // In some variants, result depends on the position:
+ return V.LoseOnRepetition;
+ }
+
+ // At some stages, some games could wait clicks only:
+ onlyClick() {
+ return false;
+ }
+
+ // Some variants use click infos:
+ doClick() {
+ return null;
+ }
+
+ // Some variants may need to highlight squares on hover (Hamilton, Weiqi...)
+ hoverHighlight() {
+ return false;
+ }
+
+ static get IMAGE_EXTENSION() {
+ // All pieces should be in the SVG format
+ return ".svg";