Пример #1
0
    List <Block> ListN()
    {
        List <bool> bools = new List <bool>()
        {
        };

        for (int variant_i = 0; variant_i < variant.Count; variant_i++)
        {
            if (CheckCount(Inv, variant[variant_i]) && ListCheck.ListContainsNew(variant[variant_i], Inv.item_list))
            {
                bools.Add(true);
            }
            else
            {
                bools.Add(false);
            }
        }

        for (int bool_i = 0; bool_i < bools.Count; bool_i++)
        {
            if (bools[bool_i])
            {
                return(variant[bool_i]);
            }
        }
        return(null);
    }
Пример #2
0
 bool CheckCount(Inventory Inv, List <Block> need_to_craft)
 {
     if (Inv.item_list.Count == 0)
     {
         return(false);
     }
     sorting_inv = new List <Block>()
     {
     };
     sorting_inv = Inv.item_list.ToList();
     sorting_inv.RemoveAll(el => !need_to_craft.Exists(el2 => el2.name == el.name));
     if (sorting_inv.Count == 0)
     {
         return(false);
     }
     if (sorting_inv.Count >= need_to_craft.Count)
     {
         return(ListCheck.ListContainsNew(need_to_craft, sorting_inv));
     }
     return(false);
 }