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

namespace FishDice.LuckyDice
{
    public sealed class ComboRuleMatch
    {
        public ComboRuleMatch(ComboRule rule)
        {
            RuleId = rule.RuleId;
            Priority = rule.Priority;
            MatcherType = rule.Matcher.MatcherType;
            Actions = rule.Actions;
        }

        public string RuleId { get; }

        public int Priority { get; }

        public string MatcherType { get; }

        public IReadOnlyList<RollActionSpec> Actions { get; }
    }

    public sealed class ComboRuleMatchResult
    {
        public ComboRuleMatchResult(IReadOnlyList<ComboRuleMatch> matches)
        {
            Matches = matches == null ? Array.Empty<ComboRuleMatch>() : matches.ToArray();
        }

        public IReadOnlyList<ComboRuleMatch> Matches { get; }

        public bool HasMatch => Matches.Count > 0;
    }
}
