Merge Atomic1 & 2
[vchess.git] / client / src / variants / Atomic2.js
diff --git a/client/src/variants/Atomic2.js b/client/src/variants/Atomic2.js
deleted file mode 100644 (file)
index 54ffb17..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-import { ChessRules, Move, PiPo } from "@/base_rules";
-import { Atomic1Rules } from "@/variants/Atomic1";
-
-export class Atomic2Rules extends Atomic1Rules {
-
-  getPotentialMovesFrom([x, y]) {
-    if (this.movesCount == 0) {
-      if ([1, 6].includes(x)) {
-        const c = this.getColor(x, y);
-        return [
-          new Move({
-            appear: [],
-            vanish: [
-              new PiPo({ x: x, y: y, p: V.PAWN, c: c })
-            ],
-            start: { x: x, y: y },
-            end: { x: x, y: y }
-          })
-        ];
-      }
-      return [];
-    }
-    return super.getPotentialMovesFrom([x, y]);
-  }
-
-  hoverHighlight([x, y]) {
-    return this.movesCount == 0 && [1, 6].includes(x);
-  }
-
-  canIplay(side, [x, y]) {
-    if (this.movesCount == 0)
-      return (this.turn == side && this.getPiece(x, y) == V.PAWN);
-    return super.canIplay(side, [x, y]);
-  }
-
-  doClick(square) {
-    if (this.movesCount >= 1) return null;
-    const [x, y] = [square[0], square[1]];
-    if (![1, 6].includes(x)) return null;
-    return new Move({
-      appear: [],
-      vanish: [
-        new PiPo({
-          x: x,
-          y: y,
-          c: this.getColor(x, y),
-          p: V.PAWN
-        })
-      ],
-      start: { x: x, y: y },
-      end: { x: x, y: y }
-    });
-  }
-
-  getNotation(move) {
-    if (move.appear.length == 0 && move.vanish.length == 1)
-      // First move in game
-      return V.CoordsToSquare(move.start) + "X";
-    return super.getNotation(move);
-  }
-
-};