< Summary

Information
Class: RaidLoop.Client.Components.PreRaidPanel
Assembly: RaidLoop.Client
File(s): /home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Client/Components/PreRaidPanel.razor
Line coverage
0%
Covered lines: 0
Uncovered lines: 41
Coverable lines: 41
Total lines: 74
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 14
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Client/Components/PreRaidPanel.razor

#LineLine coverage
 1<section class="panel top-gap">
 2    <h2>Luck Run</h2>
 3    <p>Available once every 5 minutes. Generates a random kit to raid with. Keep what you extract.</p>
 4
 5    @{
 06        var hasLuckRunLoot = RandomCharacter is not null && RandomCharacter.Inventory.Count > 0;
 7    }
 8
 09    @if (!hasLuckRunLoot)
 10    {
 011        @if (IsRandomCharacterReady)
 12        {
 013            <button class="action" disabled="@(!CanStartLuckRunRaid)" @onclick="() => OnStartLuckRun.InvokeAsync()">Ente
 014            @if (!CanStartLuckRunRaid && !string.IsNullOrWhiteSpace(LuckRunBlockReason))
 15            {
 016                <p>@LuckRunBlockReason</p>
 17            }
 18        }
 19        else
 20        {
 021            <p>Next Luck Run in: @RandomCooldownText</p>
 22        }
 23    }
 24    else
 25    {
 026        var lootCharacter = RandomCharacter!;
 027        <p><strong>@lootCharacter.Name</strong> brought back loot. Process it before the next raid.</p>
 028        @for (var i = 0; i < lootCharacter.Inventory.Count; i++)
 29        {
 030            var luckIndex = i;
 031            var item = lootCharacter.Inventory[luckIndex];
 32            <div class="row-item">
 33                <ItemTypeIcon Type="item.Type" />
 034                <span class="item-name rarity-@item.DisplayRarity.ToString().ToLower()">@ItemPresentationCatalog.GetLabe
 35                <div class="row-actions">
 036                    <button class="action" disabled="@IsStashFull" @onclick="() => OnStoreLuckRunItem.InvokeAsync(luckIn
 037                    <button class="action" @onclick="() => OnMoveToForRaid.InvokeAsync(luckIndex)">For Raid</button>
 038                    <button class="action" disabled="@(!CanSellItem(item))" @onclick="() => OnSellLuckRunItem.InvokeAsyn
 39                </div>
 40            </div>
 41        }
 042        @if (IsStashFull)
 43        {
 44            <p>Storage full. Sell or move items to For Raid.</p>
 45        }
 46    }
 47</section>
 48
 49@code {
 050    [Parameter] public RandomCharacterState? RandomCharacter { get; set; }
 051    [Parameter, EditorRequired] public bool IsRandomCharacterReady { get; set; }
 052    [Parameter, EditorRequired] public bool CanStartLuckRunRaid { get; set; }
 053    [Parameter] public string? LuckRunBlockReason { get; set; }
 054    [Parameter, EditorRequired] public string RandomCooldownText { get; set; } = string.Empty;
 055    [Parameter, EditorRequired] public bool IsStashFull { get; set; }
 056    [Parameter, EditorRequired] public PlayerStats AcceptedStats { get; set; } = PlayerStats.Default;
 057    [Parameter, EditorRequired] public PlayerStats DraftStats { get; set; } = PlayerStats.Default;
 058    [Parameter, EditorRequired] public int AvailableStatPoints { get; set; }
 059    [Parameter, EditorRequired] public bool StatsAccepted { get; set; }
 060    [Parameter, EditorRequired] public bool CanReallocateStats { get; set; }
 061    [Parameter, EditorRequired] public Func<string, int> GetDraftModifier { get; set; } = _ => 0;
 062    [Parameter, EditorRequired] public Func<string, bool> CanIncreaseDraftStat { get; set; } = _ => false;
 063    [Parameter, EditorRequired] public Func<string, bool> CanDecreaseDraftStat { get; set; } = _ => false;
 064    [Parameter, EditorRequired] public Func<Item, bool> CanSellItem { get; set; } = _ => false;
 065    [Parameter, EditorRequired] public Func<Item, int> GetSellPrice { get; set; } = _ => 0;
 066    [Parameter, EditorRequired] public EventCallback<string> OnIncrementStat { get; set; }
 067    [Parameter, EditorRequired] public EventCallback<string> OnDecrementStat { get; set; }
 068    [Parameter, EditorRequired] public EventCallback OnAcceptStats { get; set; }
 069    [Parameter, EditorRequired] public EventCallback OnReallocateStats { get; set; }
 070    [Parameter, EditorRequired] public EventCallback OnStartLuckRun { get; set; }
 071    [Parameter, EditorRequired] public EventCallback<int> OnStoreLuckRunItem { get; set; }
 072    [Parameter, EditorRequired] public EventCallback<int> OnMoveToForRaid { get; set; }
 073    [Parameter, EditorRequired] public EventCallback<int> OnSellLuckRunItem { get; set; }
 74}