Add a few variants
[xogo.git] / variants / Teleport / class.js
diff --git a/variants/Teleport/class.js b/variants/Teleport/class.js
new file mode 100644 (file)
index 0000000..5e52252
--- /dev/null
@@ -0,0 +1,19 @@
+import ChessRules from "/base_rules.js";
+
+export default class TeleportRules extends ChessRules {
+
+  static get Options() {
+    return {
+      select: C.Options.select,
+      // TODO? option "teleport king"?
+      check: C.Options.check,
+      styles: C.Options.styles.filter(s => s != "teleport")
+    };
+  }
+
+  constructor(o) {
+    o.options["teleport"] = true;
+    super(o);
+  }
+
+};