< Summary

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

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
get_Events()100%11100%
get_CurrentRaidId()100%11100%
SetRaidContext(...)50%22100%
Append(...)100%11100%
Clear()100%11100%
CreateItemSnapshots(...)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{
 15    private static readonly List<GameEvent> Entries = [];
 6
 77    public static IReadOnlyList<GameEvent> Events => Entries;
 8
 200579    public static string CurrentRaidId { get; private set; } = string.Empty;
 10
 11    public static void SetRaidContext(string raidId)
 12    {
 613        CurrentRaidId = raidId ?? string.Empty;
 614    }
 15
 16    public static void Append(GameEvent evt)
 17    {
 1001418        Entries.Add(evt);
 1001419    }
 20
 21    public static void Clear()
 22    {
 2823        Entries.Clear();
 2824        CurrentRaidId = string.Empty;
 2825    }
 26
 27    public static IReadOnlyList<ItemSnapshot> CreateItemSnapshots(IEnumerable<Item> items)
 28    {
 1001129        return items
 1001530            .Select(item => new ItemSnapshot(item.ItemDefId, item.Type.ToString(), item.DisplayRarity.ToString(), item.V
 1001131            .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
 42public sealed record ItemSnapshot(int ItemDefId, string Category, string Rarity, int Value);