All files / app/components/result-estimation result-estimation.component.html

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

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 401x 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 1x 1x 1x 1x 1x
<h2>Estimated results</h2>
<p>
    In this game involving <b>{{simulation.countPlayers()}}</b> players,
    where the objective is to identify
    <b>{{simulation.countEvil()}} wol{{simulation.countEvil() === 1 ? 'f' : 'ves'}}</b>
    among them,
    @if (simulation.game().hasSpecialVillagers) {
        with the help of special powers,
    }
    the estimated success rate is
    <b>{{simulation.winRate() | percent }}</b>
    (based on {{simulation.results().length}} simulations).
</p>
<p>
    Here is a forecast of the game duration:
</p>
<div class="stats-container">
    <div></div>
    <div class="stats-align-right stats-header-village">Good wins</div>
    <div class="stats-align-left stats-header-wolves">Evil wins</div>
    @for (stat of simulation.stats(); track stat[0]) {
        <div class="stats-y-axis">
            {{stat[0]}} day{{stat[0] !== 1 ? 's' : ''}}
        </div>
        <div class="stats-align-right">
            @if (stat[1].get(Team.VILLAGE)) {
                {{stat[1].get(Team.VILLAGE) | percent:'1.1'}}
            }
            <span class="stats-bar-village" [style.min-width.vh]="(stat[1].get(Team.VILLAGE)||0)*20"></span>
        </div>
        <div class="stats-align-left">
            <span class="stats-bar-wolves" [style.min-width.vh]="(stat[1].get(Team.WOLVES)||0)*20"></span>
            @if (stat[1].get(Team.WOLVES)) {
                {{stat[1].get(Team.WOLVES) | percent:'1.1'}}
            }
        </div>
    } @empty {
 
    }
</div>