Commit 77a6d2df authored by Dennis Willers's avatar Dennis Willers 🏀

New Start just reset the point and does not directly start a new game

parent 05b07704
Pipeline #310 canceled with stages
......@@ -55,26 +55,7 @@ export class OverviewComponent implements OnInit {
this.router.navigate(['error']);
return;
}
this.service.getGamestatus({spielname: this.sessionName}).then(value => {
const status = JSON.parse(value.status);
if (status) {
this.gameStatus.sessionID = JSON.parse(value.sessionID);
this.gameStatus.red = JSON.parse(value.red);
this.gameStatus.blue = JSON.parse(value.blue);
this.gameStatus.redTurn = JSON.parse(value.redTurn);
this.gameStatus.activeExplainer = JSON.parse(value.activeExplainer);
this.gameStatus.activeWatchdog = JSON.parse(value.activeWatchdog);
if (this.gameStatus.redTurn){
this.nextTeam = 'Rot';
this.buttonNextRoundDisabled = this.team !== 'red';
}
else{
this.nextTeam = 'Blau';
this.buttonNextRoundDisabled = this.team !== 'blue';
}
}
console.log(this.gameStatus);
}).catch(reason => console.log(reason));
this.getGameStatus();
});
}
......@@ -83,7 +64,7 @@ export class OverviewComponent implements OnInit {
this.service.newGame({spielname: this.sessionName}).then(value => {
const status = JSON.parse(value.status);
if (status) {
this.router.navigate([this.router.url + '/explainer']);
this.getGameStatus();
}
}).catch(reason => console.log(reason));
}
......@@ -97,4 +78,27 @@ export class OverviewComponent implements OnInit {
this.team = team;
this.router.navigate([this.sessionName + '/' + team]);
}
getGameStatus(): void {
this.service.getGamestatus({spielname: this.sessionName}).then(value => {
const status = JSON.parse(value.status);
if (status) {
this.gameStatus.sessionID = JSON.parse(value.sessionID);
this.gameStatus.red = JSON.parse(value.red);
this.gameStatus.blue = JSON.parse(value.blue);
this.gameStatus.redTurn = JSON.parse(value.redTurn);
this.gameStatus.activeExplainer = JSON.parse(value.activeExplainer);
this.gameStatus.activeWatchdog = JSON.parse(value.activeWatchdog);
if (this.gameStatus.redTurn){
this.nextTeam = 'Rot';
this.buttonNextRoundDisabled = this.team !== 'red';
}
else{
this.nextTeam = 'Blau';
this.buttonNextRoundDisabled = this.team !== 'blue';
}
}
console.log(this.gameStatus);
}).catch(reason => console.log(reason));
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment