Almost added TitanChess + EvolutionChess
[vchess.git] / client / src / variants / Berolina.js
index 8473b13..0765d4b 100644 (file)
@@ -1,6 +1,7 @@
 import { ChessRules } from "@/base_rules";
 
 export class BerolinaRules extends ChessRules {
+
   // En-passant after 2-sq jump
   getEpSquare(moveOrSquare) {
     if (!moveOrSquare) return undefined;
@@ -129,15 +130,11 @@ export class BerolinaRules extends ChessRules {
 
   isAttackedByPawn([x, y], color) {
     let pawnShift = (color == "w" ? 1 : -1);
-    if (x + pawnShift >= 0 && x + pawnShift < V.size.x) {
-      if (
-        this.getPiece(x + pawnShift, y) == V.PAWN &&
-        this.getColor(x + pawnShift, y) == color
-      ) {
-        return true;
-      }
-    }
-    return false;
+    return (
+      x + pawnShift >= 0 && x + pawnShift < V.size.x &&
+      this.getPiece(x + pawnShift, y) == V.PAWN &&
+      this.getColor(x + pawnShift, y) == color
+    );
   }
 
   static get SEARCH_DEPTH() {
@@ -165,4 +162,5 @@ export class BerolinaRules extends ChessRules {
     }
     return super.getNotation(move); //all other pieces are orthodox
   }
+
 };