// TODO: envoyer juste "light move", sans FEN ni notation ...etc
+// TODO: also "observers" prop, we should send moves to them too (in a web worker ? webRTC ?)
// Game logic on a variant page: 3 modes, analyze, computer or human
Vue.component('my-game', {
// gameId: to find the game in storage (assumption: it exists)
- props: ["gameId","mode","allowChat","allowMovelist"],
+ props: ["gameId","fen","mode","allowChat","allowMovelist"],
data: function() {
return {
// if oppid == "computer" then mode = "computer" (otherwise human)
vr: null, //VariantRules object, describing the game state + rules
};
},
+ watch: {
+ fen: function(newFen) {
+ this.vr = new VariantRules(newFen);
+ },
+ },
computed: {
showChat: function() {
return this.allowChat && this.mode=='human' && this.score != '*';