projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Draft Checkless. Add 'trackKingWrap' method, untested. Use 'canSelfTake'
[xogo.git]
/
variants
/
Teleport
/
class.js
diff --git
a/variants/Teleport/class.js
b/variants/Teleport/class.js
index
2698eaf
..
7ac3b34
100644
(file)
--- a/
variants/Teleport/class.js
+++ b/
variants/Teleport/class.js
@@
-5,8
+5,12
@@
export default class TeleportRules extends ChessRules {
static get Options() {
return {
select: C.Options.select,
static get Options() {
return {
select: C.Options.select,
- // TODO? option "teleport king"?
- input: C.Options.input,
+ input: C.Options.input.concat({
+ label: "Teleport king",
+ variable: "tpking",
+ type: "checkbox",
+ defaut: false
+ }),
styles: C.Options.styles.filter(s => s != "teleport")
};
}
styles: C.Options.styles.filter(s => s != "teleport")
};
}
@@
-16,4
+20,8
@@
export default class TeleportRules extends ChessRules {
super(o);
}
super(o);
}
+ canSelfTake([x1, y1], [x2, y2]) {
+ return (this.options["tpking"] || !this.isKing(x2, y2));
+ }
+
};
};