Пример #1
0
 public GUI()
 {
     Items  = new ITEMS("Temp.json");
     Filter = new FILTER(ref Items);
     Sorter = new SORTER(ref Items);
     Select = new SELECT(ref Items);
     Search = new SEARCH(ref Items);
     Import = new IMPORT(ref Items);
     Export = new EXPORT(ref Items);
     Mulits = new MULTIS(ref Items);
     Nexusx = new NEXUSX(ref Items);
 }
Пример #2
0
        //"Grammer","XXX",23,4
        public List <ITEM> FindTopSim(ref ITEMS Items, List <string> Keys, List <string> Vals, int?ExcludedID, int TopX)
        {
            List <ITEM>   Res     = new List <ITEM>();
            List <SimRes> ResTemp = new List <SimRes>();

            if (Keys.Count == 0 || Items.Internal.Count == 0 || Keys.Count != Vals.Count || TopX <= 0)
            {
                return(Res);
            }

            foreach (ITEM Item in Items.Internal)
            {
                if (ExcludedID != null && ExcludedID == Item.UniqueID)
                {
                    continue;
                }
                ResTemp.Add(new SimRes()
                {
                    Sim = Sim(Item, Keys, Vals), ID = Item.UniqueID,
                });
            }
            ResTemp.Sort(SortList);
            int j = 0;

            for (int i = 0; i < TopX; i++)
            {
                if (Vals[0] != Items.Internal[Items.GetIndexByID(ResTemp[j].ID)].MainBody[Keys[0]])
                {
                    Res.Add(Items.Internal[Items.GetIndexByID(ResTemp[j].ID)]);
                }
                else
                {
                    i--;
                }
                j++;
            }

            return(Res);
        }
Пример #3
0
 public SORTER(ref ITEMS Items)
 {
     this.Items = Items;
     Mode       = SupportedMode[0];
 }
Пример #4
0
 public MULTIS(ref ITEMS Items)
 {
     this.Items = Items;
 }
Пример #5
0
 public NEXUSX(ref ITEMS Items)
 {
     this.Items = Items;
 }
Пример #6
0
 public EXPORT(ref ITEMS Items)
 {
     this.Items = Items;
 }
Пример #7
0
 public SEARCH(ref ITEMS Items)
 {
     this.Items = Items;
 }
Пример #8
0
 public SELECT(ref ITEMS Items)
 {
     this.Items = Items;
     Mode       = SupportedMode[0];
 }