public static String getImagePath(Inv inv, String Name)
        {
            String res = "";

            try {
                res = inv.imagePaths.First(i => i.Name == Name).Path;
            } catch (Exception e) {
                log(e.Message);
            }
            return(res);
        }
        public static String getImagePath(Inv inv, int indx)
        {
            String res  = "";
            String Name = "";

            try {
                Name = inv.items.First(i => i.Index == indx).Name;
                res  = getImagePath(inv, Name);
            } catch (Exception e) {
                log(e.Message);
            }
            return(res);
        }
        public static int tryMoveItems(Inv inv, int IndexFrom, int IndexTo)
        {
            log("tryMoveItems");
            InvItem foundItem  = null;
            InvItem foundItem1 = null;

            try {
                foundItem  = inv.items.Find(i => i.Index == IndexFrom);
                foundItem1 = inv.items.Find(i => i.Index == IndexTo);
            } catch (Exception e) {
                log(e.Message);
                return(-1);
            }

            return(0);
        }
        public static int MoveItems(Inv inv, int IndexFrom, int IndexTo)
        {
            log("MoveItems");
            int foundItemid;
            int foundItemid1;

            try {
                lock (inv.items) {
                    foundItemid  = inv.items.FindIndex(i => i.Index == IndexFrom);
                    foundItemid1 = inv.items.FindIndex(i => i.Index == IndexTo);

                    inv.items[foundItemid].Index  = IndexTo;
                    inv.items[foundItemid1].Index = IndexFrom;
                }
            } catch (Exception e) {
                log(e.Message);
                return(-1);
            }

            return(0);
        }
        public static int AddItems(Inv inv, String name, int prefIndex, int current)
        {
            int res = AddItems(inv.items, inv.AllItems, inv.ExceedMaxItems, inv.LastIndex, name, prefIndex, current, inv.MaxIndex, inv.CellMaxItems);

            return(res);
        }
        public static int tryGetItems(Inv inv, String name, int current)
        {
            int res = tryGetItems(inv.items, name, current);

            return(res);
        }
        public static int GetItems(Inv inv, String name, int prefIndex, int current)
        {
            int res = GetItems(inv.items, name, prefIndex, current);

            return(res);
        }