Some fixes + draft newmove pingback logic (unfinished, not working)
[vchess.git] / client / src / variants / Recycle.js
index d99228c..9f43ad8 100644 (file)
@@ -18,8 +18,8 @@ export const VariantRules = class RecycleRules extends ChessRules {
     });
   }
 
-  static GenRandInitFen() {
-    return ChessRules.GenRandInitFen() + " 0000000000";
+  static GenRandInitFen(randomness) {
+    return ChessRules.GenRandInitFen(randomness) + " 0000000000";
   }
 
   getFen() {
@@ -28,6 +28,16 @@ export const VariantRules = class RecycleRules extends ChessRules {
     );
   }
 
+  getFenForRepeat() {
+    return (
+      this.getBaseFen() + "_" +
+      this.getTurnFen() + "_" +
+      this.getFlagsFen() + "_" +
+      this.getEnpassantFen() + "_" +
+      this.getReserveFen()
+    );
+  }
+
   getReserveFen() {
     let counts = new Array(10);
     for (
@@ -74,7 +84,7 @@ export const VariantRules = class RecycleRules extends ChessRules {
   }
 
   // Used by the interface:
-  getReservePpath(color, index) {
+  getReservePpath(index, color) {
     return color + V.RESERVE_PIECES[index];
   }