this.loadGame();
else if (!!this.fen)
{
- this.vr = new VariantRules(this.fen);
+ this.vr = new V(this.fen);
this.fenStart = this.fen;
}
// TODO: if I'm one of the players in game, then:
},
translate: translate,
newGameFromFen: function() {
- this.vr = new VariantRules(this.fen);
+ this.vr = new V(this.fen);
this.moves = [];
this.cursor = -1;
this.fenStart = this.fen;
if (this.cursor == this.moves.length)
this.moves.push(move);
else
- this.moves = this.moves.slice(0,this.cursor-1).concat([move]);
+ this.moves = this.moves.slice(0,this.cursor).concat([move]);
}
// Is opponent in check?
this.incheck = this.vr.getCheckSquares(this.vr.turn);
this.moves.pop();
},
gotoMove: function(index) {
- this.vr = new VariantRules(this.moves[index].fen);
+ this.vr = new V(this.moves[index].fen);
this.cursor = index;
this.lastMove = this.moves[index];
},
gotoBegin: function() {
- this.vr = new VariantRules(this.fenStart);
+ this.vr = new V(this.fenStart);
this.cursor = -1;
this.lastMove = null;
},