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

namespace FishDice.LuckyDice
{
    public sealed class ComboRule
    {
        public ComboRule(
            string ruleId,
            int priority,
            ComboMatcherSpec matcher,
            IReadOnlyList<RollActionSpec> actions,
            bool stopAfterMatched)
        {
            RuleId = ruleId ?? throw new ArgumentNullException(nameof(ruleId));
            Priority = priority;
            Matcher = matcher ?? throw new ArgumentNullException(nameof(matcher));
            Actions = actions == null ? Array.Empty<RollActionSpec>() : actions.ToArray();
            StopAfterMatched = stopAfterMatched;
        }

        public string RuleId { get; }

        public int Priority { get; }

        public ComboMatcherSpec Matcher { get; }

        public IReadOnlyList<RollActionSpec> Actions { get; }

        public bool StopAfterMatched { get; }
    }
}
