< Summary

Information
Class: RaidLoop.Core.Contracts.PlayerSnapshot
Assembly: RaidLoop.Core
File(s): /home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/Contracts/PlayerSnapshot.cs
Line coverage
100%
Covered lines: 44
Uncovered lines: 0
Coverable lines: 44
Total lines: 85
Line coverage: 100%
Branch coverage
100%
Covered branches: 8
Total branches: 8
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%88100%
get_Money()100%11100%
get_MainStash()100%11100%
get_OnPersonItems()100%11100%
get_ShopStock()100%11100%
get_ItemRules()100%11100%
get_PlayerConstitution()100%11100%
get_PlayerMaxHealth()100%11100%
get_RandomCharacterAvailableAt()100%11100%
get_RandomCharacter()100%11100%
get_ActiveRaid()100%11100%
get_AcceptedStats()100%11100%
get_DraftStats()100%11100%
get_AvailableStatPoints()100%11100%
get_StatsAccepted()100%11100%

File(s)

/home/runner/work/RaidLoop/RaidLoop/src/RaidLoop.Core/Contracts/PlayerSnapshot.cs

#LineLine coverage
 1using System.Text.Json.Serialization;
 2
 3namespace RaidLoop.Core.Contracts;
 4
 5public sealed record OnPersonSnapshot(Item Item, bool IsEquipped);
 6
 7public sealed record ItemRuleSnapshot(
 8    int ItemDefId,
 9    ItemType Type,
 10    int Weight,
 11    int Slots,
 12    Rarity Rarity);
 13
 14public sealed record ShopOfferSnapshot(
 15    int ItemDefId,
 16    int Price,
 17    int Stock);
 18
 19public sealed record RandomCharacterSnapshot
 20{
 21    public RandomCharacterSnapshot(string Name, IReadOnlyList<Item> Inventory, PlayerStats Stats)
 22    {
 23        ArgumentNullException.ThrowIfNull(Stats);
 24        this.Name = Name;
 25        this.Inventory = Inventory;
 26        this.Stats = Stats;
 27    }
 28
 29    public string Name { get; init; }
 30    public IReadOnlyList<Item> Inventory { get; init; }
 31    public PlayerStats Stats { get; init; }
 32}
 33
 34public sealed record PlayerSnapshot
 35{
 2436    public PlayerSnapshot(
 2437        int Money,
 2438        IReadOnlyList<Item> MainStash,
 2439        IReadOnlyList<OnPersonSnapshot> OnPersonItems,
 2440        int PlayerConstitution,
 2441        int PlayerMaxHealth,
 2442        DateTimeOffset RandomCharacterAvailableAt,
 2443        RandomCharacterSnapshot? RandomCharacter,
 2444        RaidSnapshot? ActiveRaid,
 2445        PlayerStats? AcceptedStats = null,
 2446        PlayerStats? DraftStats = null,
 2447        int AvailableStatPoints = PlayerStatRules.StartingPool,
 2448        bool StatsAccepted = false,
 2449        IReadOnlyList<ShopOfferSnapshot>? ShopStock = null,
 2450        IReadOnlyList<ItemRuleSnapshot>? ItemRules = null)
 51    {
 2452        this.Money = Money;
 2453        this.MainStash = MainStash;
 2454        this.OnPersonItems = OnPersonItems;
 2455        this.ShopStock = ShopStock ?? [];
 2456        this.ItemRules = ItemRules ?? [];
 2457        this.PlayerConstitution = PlayerConstitution;
 2458        this.PlayerMaxHealth = PlayerMaxHealth;
 2459        this.RandomCharacterAvailableAt = RandomCharacterAvailableAt;
 2460        this.RandomCharacter = RandomCharacter;
 2461        this.ActiveRaid = ActiveRaid;
 2462        this.AcceptedStats = AcceptedStats ?? PlayerStats.Default;
 2463        this.DraftStats = DraftStats ?? PlayerStats.Default;
 2464        this.AvailableStatPoints = AvailableStatPoints;
 2465        this.StatsAccepted = StatsAccepted;
 2466    }
 67
 4568    public int Money { get; init; }
 4669    public IReadOnlyList<Item> MainStash { get; init; }
 4470    public IReadOnlyList<OnPersonSnapshot> OnPersonItems { get; init; }
 4771    public IReadOnlyList<ShopOfferSnapshot> ShopStock { get; init; }
 4472    public IReadOnlyList<ItemRuleSnapshot> ItemRules { get; init; }
 3073    public int PlayerConstitution { get; init; }
 4474    public int PlayerMaxHealth { get; init; }
 75
 76    [JsonConverter(typeof(FlexibleDateTimeOffsetJsonConverter))]
 4377    public DateTimeOffset RandomCharacterAvailableAt { get; init; }
 78
 5079    public RandomCharacterSnapshot? RandomCharacter { get; init; }
 5480    public RaidSnapshot? ActiveRaid { get; init; }
 5981    public PlayerStats AcceptedStats { get; init; }
 4582    public PlayerStats DraftStats { get; init; }
 4583    public int AvailableStatPoints { get; init; }
 4584    public bool StatsAccepted { get; init; }
 85}