< Summary

Information
Class: RaidLoop.Core.ItemSnapshot
Assembly: RaidLoop.Core
File(s): /home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/GameEventLog.cs
Line coverage
100%
Covered lines: 1
Uncovered lines: 0
Coverable lines: 1
Total lines: 42
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_ItemDefId()100%11100%

File(s)

/home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/GameEventLog.cs

#LineLine coverage
 1namespace RaidLoop.Core;
 2
 3public static class GameEventLog
 4{
 5    private static readonly List<GameEvent> Entries = [];
 6
 7    public static IReadOnlyList<GameEvent> Events => Entries;
 8
 9    public static string CurrentRaidId { get; private set; } = string.Empty;
 10
 11    public static void SetRaidContext(string raidId)
 12    {
 13        CurrentRaidId = raidId ?? string.Empty;
 14    }
 15
 16    public static void Append(GameEvent evt)
 17    {
 18        Entries.Add(evt);
 19    }
 20
 21    public static void Clear()
 22    {
 23        Entries.Clear();
 24        CurrentRaidId = string.Empty;
 25    }
 26
 27    public static IReadOnlyList<ItemSnapshot> CreateItemSnapshots(IEnumerable<Item> items)
 28    {
 29        return items
 30            .Select(item => new ItemSnapshot(item.ItemDefId, item.Type.ToString(), item.DisplayRarity.ToString(), item.V
 31            .ToList();
 32    }
 33}
 34
 35public sealed record GameEvent(
 36    string EventName,
 37    string RaidId,
 38    IReadOnlyList<ItemSnapshot> Items,
 39    DateTimeOffset Timestamp,
 40    int TotalValue = 0);
 41
 1002942public sealed record ItemSnapshot(int ItemDefId, string Category, string Rarity, int Value);

Methods/Properties

get_ItemDefId()