using System;
using System.Collections.Generic;

namespace FishDice.LuckyDice
{
    public sealed class LuckyDiceCandidateConfig
    {
        public LuckyDiceCandidateConfig(
            string resultKey,
            string targetKey,
            int? resultSlotCount,
            int weight,
            bool enabled,
            int minLevel,
            IReadOnlyList<string> sourceFilter,
            bool isDefault)
        {
            ResultKey = resultKey;
            TargetKey = targetKey;
            ResultSlotCount = resultSlotCount;
            Weight = weight;
            Enabled = enabled;
            MinLevel = minLevel;
            SourceFilter = sourceFilter == null
                ? Array.Empty<string>()
                : new List<string>(sourceFilter).AsReadOnly();
            IsDefault = isDefault;
        }

        public string ResultKey { get; }

        public string TargetKey { get; }

        public int? ResultSlotCount { get; }

        public int Weight { get; }

        public bool Enabled { get; }

        public int MinLevel { get; }

        public IReadOnlyList<string> SourceFilter { get; }

        public bool IsDefault { get; }
    }

    public sealed class TargetModeConfig
    {
        public TargetModeConfig(string resultKey, string targetKey, string modeKey)
        {
            ResultKey = resultKey;
            TargetKey = targetKey;
            ModeKey = modeKey;
        }

        public string ResultKey { get; }

        public string TargetKey { get; }

        public string ModeKey { get; }
    }
}
