GetUsedItems() public method

public GetUsedItems ( ) : int>>.List
return int>>.List
        public static void UpdateUsedItems(Hunt h)
        {
            var usedItems = h.GetUsedItems();

            lock (lootLock) {
                foreach (var item in usedItems)
                {
                    int itemid = item.Item1.id;
                    int amount = item.Item2;

                    int    value  = 0;
                    object result = ExecuteScalar(String.Format("SELECT itemid FROM {0} WHERE itemid={1}", h.GetWasteTableName(), itemid));
                    if (result != null && int.TryParse(result.ToString(), out value))
                    {
                        ExecuteNonQuery(String.Format("UPDATE {0} SET amount={1} WHERE itemid={2}", h.GetWasteTableName(), amount, itemid));
                    }
                    else
                    {
                        ExecuteNonQuery(String.Format("INSERT INTO {0} (itemid, amount) VALUES ({1}, {2})", h.GetWasteTableName(), itemid, amount));
                    }
                }
            }
        }
        public static void UpdateUsedItems(Hunt h)
        {
            var usedItems = h.GetUsedItems();
            lock(lootLock) {
                foreach (var item in usedItems) {
                    int itemid = item.Item1.id;
                    int amount = item.Item2;

                    int value = 0;
                    object result = ExecuteScalar(String.Format("SELECT itemid FROM {0} WHERE itemid={1}", h.GetWasteTableName(), itemid));
                    if (result != null && int.TryParse(result.ToString(), out value)) {
                        ExecuteNonQuery(String.Format("UPDATE {0} SET amount={1} WHERE itemid={2}", h.GetWasteTableName(), amount, itemid));
                    } else {
                        ExecuteNonQuery(String.Format("INSERT INTO {0} (itemid, amount) VALUES ({1}, {2})", h.GetWasteTableName(), itemid, amount));
                    }
                }
            }
        }
Beispiel #3
0
 public static List<Tuple<Item, int>> GetUsedItems(Hunt hunt)
 {
     return hunt.GetUsedItems();
 }
Beispiel #4
0
 public static List <Tuple <Item, int> > GetUsedItems(Hunt hunt)
 {
     return(hunt.GetUsedItems());
 }