vr_tmp.play(move);
move.fen = vr_tmp.getFen();
});
+ if (this.game.fenStart.indexOf(" b ") >= 0 ||
+ (this.moves.length > 0 && this.moves[0].color == "b"))
+ {
+ // 'end' is required for Board component to check lastMove for e.p.
+ this.moves.unshift({color: "w", notation: "...", end: {x:-1,y:-1}});
+ }
const L = this.moves.length;
this.cursor = L-1;
this.lastMove = (L > 0 ? this.moves[L-1] : null);
render(h) {
if (this.moves.length == 0)
return;
- if (this.moves[0].color == "b")
- this.moves.unshift({color: "w", notation: "..."});
let tableContent = [];
let moveCounter = 0;
let tableRow = undefined;
<template lang="pug">
main
- BaseGame(:game="game" :vr="vr" ref="basegame")
+ .row
+ .col-sm-12.col-md-10.col-md-offset-1
+ BaseGame(:game="game" :vr="vr" ref="basegame")
</template>
<script>
const vModule = await import("@/variants/" + this.game.vname + ".js");
window.V = vModule.VariantRules;
this.vr = new V(this.game.fen);
+ // fenStart initialized in the end, after definition of V,
+ // because it triggers a reset on BaseGame component.
+ this.$set(this.game, "fenStart", this.gameRef.fen); //TODO: Vue3...
},
},
};