All files / app/components/team-roles team-roles.component.ts

100% Statements 30/30
100% Branches 2/2
100% Functions 1/1
100% Lines 30/30

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 301x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 3x 3x 3x 3x 3x 3x 3x
import { Component, computed, inject } from "@angular/core";
import { GameSimulator } from "../../services/game-simulator/game-simulator.service";
import { RoleIconComponent } from "../role-icon/role-icon.component";
 
@Component({
  selector: 'app-team-roles',
  standalone: true,
  imports: [
    RoleIconComponent,
  ],
 
  template: `
    <h2>Role distribution</h2>
    <div class="bordered auto-arrange-icons">
      @for (role of roles(); track $index) {
        <app-role-icon [role]="role"></app-role-icon>
      } @empty {
        No players
      }
    </div>
  `,
})
export class TeamRolesComponent {
  simulation = inject(GameSimulator);
 
  roles = computed(() => {
    return this.simulation.game().roles;
  });
 
}