add-game.component.ts code cleanup

This commit is contained in:
Patrick Müller 2022-09-10 18:45:22 +02:00
parent c6302ad8c0
commit f69f7f1731
Signed by: Paddy
GPG Key ID: 37ABC11275CAABCE

View File

@ -16,6 +16,16 @@ export class AddGameComponent implements OnInit {
currentPage: number = 0;
constructor() {
this.generateDemoData();
}
ngOnInit(): void {
}
/**
* Generates demo data to test the UI
*/
generateDemoData() {
this.potentialPlayers.push({
firebonkId: 1,
uuid: 'abc-def-ghi-j',
@ -45,9 +55,22 @@ export class AddGameComponent implements OnInit {
this.actualPlayers.push(...this.potentialPlayers.slice(0, 4));
}
ngOnInit(): void {
/**
* Switches the entry mask UI to the next page
*/
switchToNextPage(): void {
this.currentPage++;
}
/**
* ____ __
* / __ \/ /___ ___ _____ __________
* / /_/ / / __ `/ / / / _ \/ ___/ ___/
* / ____/ / /_/ / /_/ / __/ / (__ )
* /_/ /_/\__,_/\__, /\___/_/ /____/
* /____/
*/
/**
* Toggles if the given player is should be an active player for the current game
* @param player The player to toggle the activity for
@ -78,11 +101,12 @@ export class AddGameComponent implements OnInit {
}
/**
* Switches the entry mask UI to the next page
* ___ __
* / | ____ ____ ____ __ ______ ________ ____ ___ ___ ____ / /______
* / /| | / __ \/ __ \/ __ \/ / / / __ \/ ___/ _ \/ __ `__ \/ _ \/ __ \/ __/ ___/
* / ___ |/ / / / / / / /_/ / /_/ / / / / /__/ __/ / / / / / __/ / / / /_(__ )
* /_/ |_/_/ /_/_/ /_/\____/\__,_/_/ /_/\___/\___/_/ /_/ /_/\___/_/ /_/\__/____/
*/
switchToNextPage(): void {
this.currentPage++;
}
/**
* Toggles the activity status for the given announcement