Entities/Puzzle/PuzzleStorm/StormDay.cs

Data model for a PuzzleStorm day. It stores an Id string and several integer stats, and exposes a computed Date parsed from the Id which is expected in 'yyyy/MM/dd' format.

#nullable enable annotations

namespace LichessNET.Entities.Puzzle.PuzzleStorm;

public class StormDay
{
    public string Id { get; set; }

    public DateTime Date
    {
        get
        {
            return new DateTime(
                int.Parse(Id.Split('/')[0]),
                int.Parse(Id.Split('/')[1]),
                int.Parse(Id.Split('/')[2])
            );
        }
    }

    public int Combo { get; set; }
    public int Errors { get; set; }
    public int Highest { get; set; }
    public int Moves { get; set; }
    public int Runs { get; set; }
    public int Score { get; set; }
    public int Time { get; set; }
}