using System;
using NHSE.Core;

namespace SysBot.ACNHOrders
{
    [Serializable]
    public class DropBotConfig : IConfigItem
    {
        private int _maxDropCount = 7;
        private bool _wrapItems = false;

        /// <summary> When enabled, bot picks up items when idle for <see cref="NoActivitySeconds"/> seconds. </summary>
        public bool AutoClean { get; set; }

        /// <summary> When <see cref="AutoClean"/> is enabled, the bot will pick up items after the a certain amount of inactive time. </summary>
        public int NoActivitySeconds { get; set; } = 60;

        /// <summary> Amount of times to perform a pick-up item action. </summary>
        public int MaxDropCount
        {
            get => _maxDropCount;
            set => _maxDropCount = Math.Max(1, Math.Min(40, value));
        }

        /// <summary> Amount of times to perform a pick-up item action. </summary>
        public int PickupCount { get; set; } = 5;

        /// <summary> Should we inject our drop request to the entire inventory? </summary>
        public bool UseLegacyDrop { get; set; } = false;

        /// <summary>
        /// Wraps all items generated by the bot so that the "Drop" option is the first option when interacting with it in the player inventory.
        ///  </summary>
        /// <remarks>
        /// Doesn't wrap DIY recipes. Legacy drop is required to wrap items.
        /// </remarks>
        public bool WrapAllItems // doesn't wrap DIY recipes
        {
            get => UseLegacyDrop && _wrapItems;
            set => _wrapItems = value;
        }

        /// <summary> Wrapping paper to apply when <see cref="WrapAllItems"/> is true. </summary>
        public ItemWrappingPaper WrappingPaper { get; set; } = ItemWrappingPaper.Black;

        /// <summary> Should we allow the dropping of broken items such as tent kits, mailboxes, unpickupables etc </summary>
        public bool SkipDropCheck { get; set; } = false;
    }
}
