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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 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 3x 3x 3x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import {Component, inject} from '@angular/core';
import {GameSimulator} from "../../services/game-simulator/game-simulator.service";
import {Game} from "../../models/game";
import {NumberInputComponent} from "../number-input/number-input.component";
import { TeamRolesComponent } from '../team-roles/team-roles.component';
import { Role } from '../../models/role';
@Component({
selector: 'app-team-selector',
standalone: true,
imports: [
NumberInputComponent,
TeamRolesComponent,
],
templateUrl: "team-selector.component.html",
})
export class TeamSelectorComponent {
form = {
players: 0,
wolves: 0,
guards: 0,
healers: 0,
princes: 0,
masons: 0,
scouts: 0,
lycans: 0,
};
simulation = inject(GameSimulator)
constructor() {
const game = this.simulation.game();
this.form.players = game.players;
this.form.wolves = game.roleCount(Role.WEREWOLF);
this.form.guards = game.roleCount(Role.GUARD);
this.form.healers = game.roleCount(Role.HEALER);
this.form.princes = game.roleCount(Role.PRINCE);
this.form.masons = game.roleCount(Role.MASON);
this.form.scouts = game.roleCount(Role.SCOUT);
this.form.lycans = game.roleCount(Role.LYCAN);
}
onChange() {
const players = this.form.players;
const wolves = this.form.wolves;
const guards = this.form.guards;
const healers = this.form.healers;
const princes = this.form.princes;
const masons = this.form.masons;
const scouts = this.form.scouts;
const lycans = this.form.lycans;
if (isNaN(players) || isNaN(wolves)) return;
const game = new Game(players, [
{role: Role.WEREWOLF, count: wolves},
{role: Role.GUARD, count: guards},
{role: Role.HEALER, count: healers},
{role: Role.PRINCE, count: princes},
{role: Role.MASON, count: masons},
{role: Role.SCOUT, count: scouts},
{role: Role.LYCAN, count: lycans},
]);
this.simulation.restart(game);
}
}
|