using MultiLayout;
using MultiLayout.UiModule;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FLY.Thick.FilmCasting.UI.UiModule
{
    /// <summary>
    /// 全部参数
    /// </summary>
    public class ScanMmGraphParams : UIModuleParams<ScanMmGraphItemParam>
    {
        /// <summary>
        /// X轴的间隔
        /// </summary>
        public int XStep { get; set; } = 10;

        public ScanMmGraphParams()
        {
            string path = System.IO.Path.Combine(FlyLayout.BasePath, "scanmmgraph.json");
            FilePath = path;
        }

        static ScanMmGraphParams current = null;
        public static ScanMmGraphParams Current
        {
            get
            {
                if (current == null)
                {
                    current = new ScanMmGraphParams();
                    current.Load();
                }
                return current;
            }
        }

        public void MatchParam(string uiModule, int[] IDs)
        {
            if (Items.RemoveAll(i => { return (i.UiModule == uiModule) && (!IDs.Contains(i.ID)); }) > 0)
            {
                Save();
            }
        }
        public override void MatchParam(int[] IDs)
        {
            MatchParam("scanMmGraph", IDs);
        }
    }
}
