using System.Collections.Generic;
using System.Linq;

namespace FishDice.LuckyDice
{
    public sealed class ComboFacts
    {
        public ComboFacts(
            string rollSessionId,
            DiceSetType diceSetType,
            int diceCount,
            IReadOnlyList<DiceFace> faces,
            IReadOnlyDictionary<string, int> faceCounts,
            int numberSum,
            IReadOnlyList<int> numberValues,
            int cloverCount,
            string normalizedKey,
            string orderedKey)
        {
            RollSessionId = rollSessionId;
            DiceSetType = diceSetType;
            DiceCount = diceCount;
            Faces = faces.ToArray();
            FaceCounts = faceCounts.ToDictionary(pair => pair.Key, pair => pair.Value);
            NumberSum = numberSum;
            NumberValues = numberValues.ToArray();
            CloverCount = cloverCount;
            HasClover = cloverCount > 0;
            NormalizedKey = normalizedKey;
            OrderedKey = orderedKey;
        }

        public string RollSessionId { get; }

        public DiceSetType DiceSetType { get; }

        public int DiceCount { get; }

        public IReadOnlyList<DiceFace> Faces { get; }

        public IReadOnlyDictionary<string, int> FaceCounts { get; }

        public int NumberSum { get; }

        public IReadOnlyList<int> NumberValues { get; }

        public int CloverCount { get; }

        public bool HasClover { get; }

        public string NormalizedKey { get; }

        public string OrderedKey { get; }
    }
}
