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 ScanGraphParams : UIModuleParams<ScanGraphItemParam>
    {

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

        static ScanGraphParams current = null;
        public static ScanGraphParams Current
        {
            get
            {
                if (current == null)
                {
                    current = new ScanGraphParams();
                    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("scangraph", IDs);
        }
    }
}
