changed buttons for a drawer in the track page

This commit is contained in:
Quentin Roussel
2024-03-27 20:51:06 +01:00
parent e6563f2da5
commit 76ed97e904
9 changed files with 70 additions and 29 deletions

View File

@@ -15,11 +15,15 @@ export default class Game {
getNewTeamId() {
let id = null;
while(id === null || this.teams.find(t => t.id === id)) {
id = Math.floor(Math.random() * 1000000);
id = Math.floor(Math.random() * 1_000_000);
}
return id;
}
createCaptureCode() {
return Math.floor(Math.random() * 10000)
}
addTeam(teamName) {
let id = this.getNewTeamId();
this.teams.push({
@@ -27,9 +31,10 @@ export default class Game {
name: teamName,
chasing: null,
chased: null,
currentLocation: [0, 0],
lastSentLocation: [0, 0],
enemyLocation: [0, 0],
currentLocation: null,
lastSentLocation: null,
enemyLocation: null,
captureCode: this.createCaptureCode(),
sockets: []
});
this.updateTeamChasing();