refactor: remove player list workaround

This commit is contained in:
eneller
2026-02-01 12:01:42 +01:00
parent 2999d8eee7
commit 8493e742e9
4 changed files with 5 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import { Player } from './model';
})
export class DataService {
private players: Player[] = [];
teams: Player[][] = [];
setPlayers(players: Player[]){
for (let player of players){

View File

@@ -26,7 +26,7 @@ export class Player{
return [this.name, values];
}
valueOf(): string{
toString(): string{
return this.name;
}
static deSerialize(name: string, values: string): Player{

View File

@@ -30,7 +30,7 @@
</tr>
</thead>
<tbody>
@for (team of teamsArray; track $index) {
@for (team of data.teams; track $index) {
<tr>
<td style="text-wrap: wrap;">{{ team.length | number }}</td>
<td class="wrap-cell">{{ team }}</td>

View File

@@ -19,7 +19,6 @@ export class ScreenBasicComponent {
numTeamsSelectorValue = "2";
numTeamsSelected = 2;
nTeamsValue = "4";
teamsArray: string[][] = [];
onButtonGenerate(): void{
if(this.numTeamsSelectorValue === 'n'){
@@ -40,10 +39,10 @@ export class ScreenBasicComponent {
let n = localPlayers[index];
localPlayers.splice(index,1);
let team = iterator.next().value;
team.push(n.name);
team.push(n);
}
this.teamsArray = teams;
this.data.teams = teams;
}
}