projects
/
xogo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Cleaner fen generation + first draft of Apocalypse + a few fixes
[xogo.git]
/
variants
/
Hex
/
class.js
diff --git
a/variants/Hex/class.js
b/variants/Hex/class.js
index
8721227
..
0797c91
100644
(file)
--- a/
variants/Hex/class.js
+++ b/
variants/Hex/class.js
@@
-35,6
+35,9
@@
export default class HexRules extends ChessRules {
get noAnimate() {
return true;
}
get noAnimate() {
return true;
}
+ get clickOnly() {
+ return true;
+ }
doClick(coords) {
if (
doClick(coords) {
if (
@@
-71,10
+74,13
@@
export default class HexRules extends ChessRules {
return res;
}
return res;
}
- genRandInitFen() {
+ genRandInit
Base
Fen() {
// NOTE: size.x == size.y (square boards)
const emptyCount = C.FenEmptySquares(this.size.x);
// NOTE: size.x == size.y (square boards)
const emptyCount = C.FenEmptySquares(this.size.x);
- return (emptyCount + "/").repeat(this.size.x).slice(0, -1) + " w 0";
+ return {
+ fen: (emptyCount + "/").repeat(this.size.x).slice(0, -1) + " w 0",
+ o: {}
+ };
}
getSvgChessboard() {
}
getSvgChessboard() {
@@
-162,7
+168,9
@@
export default class HexRules extends ChessRules {
get size() {
const baseRatio = 1.6191907514450865; //2801.2 / 1730, "widescreen"
get size() {
const baseRatio = 1.6191907514450865; //2801.2 / 1730, "widescreen"
- const rotate = window.innerWidth < window.innerHeight; //"vertical screen"
+ const rc =
+ document.getElementById(this.containerId).getBoundingClientRect();
+ const rotate = rc.width < rc.height; //"vertical screen"
return {
x: this.options["bsize"],
y: this.options["bsize"],
return {
x: this.options["bsize"],
y: this.options["bsize"],