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

namespace FishDice.LuckyDice
{
    public sealed class RollActionSpec
    {
        public RollActionSpec(string actionType)
            : this(actionType, null)
        {
        }

        public RollActionSpec(string actionType, IReadOnlyDictionary<string, string> parameters)
        {
            ActionType = actionType ?? throw new ArgumentNullException(nameof(actionType));
            Params = parameters == null
                ? new Dictionary<string, string>()
                : parameters.ToDictionary(pair => pair.Key, pair => pair.Value);
        }

        public string ActionType { get; }

        public IReadOnlyDictionary<string, string> Params { get; }
    }
}
