using System;

namespace FishDice.LuckyDice
{
    public readonly struct DiceFace
    {
        public DiceFace(DiceSetType setType, string key, int? numberValue)
        {
            SetType = setType;
            Key = key ?? throw new ArgumentNullException(nameof(key));
            NumberValue = numberValue;
        }

        public DiceSetType SetType { get; }

        public string Key { get; }

        public int? NumberValue { get; }

        public static DiceFace NormalNumber(int value)
        {
            return new DiceFace(DiceSetType.Normal, value.ToString(), value);
        }

        public static DiceFace NormalClover()
        {
            return new DiceFace(DiceSetType.Normal, LuckyDiceKeys.CloverFaceKey, null);
        }

        public static DiceFace LuckyResult(string key)
        {
            return new DiceFace(DiceSetType.Lucky, key, null);
        }
    }
}
