</div>
`,
methods: {
+ // TODO: clic sur "Valider" télécharge la ronde courante
+ // TODO: mémoriser les appariements passés pour éviter que les mêmes joueurs se rencontrent plusieurs fois
doPairings: function() {
// Simple case first: 4 by 4
let tables = [];
return {
time: 0, //remaining time, in seconds
running: false,
+ initialTime: 5400, //1h30
};
},
template: `
},
reset: function(e) {
this.running = false;
- this.time = 5400; //1:30
+ this.time = this.initialTime;
},
start: function() {
if (!this.running)
this.running = false;
return;
}
+ if (this.time == this.initialTime)
+ new Audio("sounds/gong.mp3").play(); //gong at the beginning
setTimeout(() => {
if (this.running)
this.time--;
.filter( line => { return line.length > 0; }) //remove empty lines
.map( line => {
let parts = line.split(",");
- return {prenom: parts[0], nom: parts[1], pdt: 0, session:0, available: 1};
+ let p = { prenom: parts[0], nom: parts[1] };
+ p.pdt = parts.length > 2 ? parseFloat(parts[2]) : 0;
+ p.session = parts.length > 3 ? parseInt(parts[3]) : 0;
+ p.available = parts.length > 4 ? parts[4] : 1;
+ return p;
});
this.addToto(players);
this.players = players;
+ this.commitScores(); //save players in memory
},
},
});