Exemple #1
0
 public static void Add(int ID, Users.Item ItemClass)
 {
     if (!Items.ContainsKey(ID))
     {
         Items.Add(ID, ItemClass);
     }
 }
        public static void loadItems(int userID)
        {
            int[] itemIDs = Database.runReadColumnIntegers("SELECT id FROM user_items WHERE user_id = " + userID, 0);

            foreach (int tempID in itemIDs)
            {
                Users.Item _item = new Users.Item(tempID);
                _item.ItemID = int.Parse(Database.runRead("SELECT item_id FROM user_items WHERE id = " + tempID));
                _item.UserID = int.Parse(Database.runRead("SELECT user_id FROM user_items WHERE id = " + tempID));

                int tempEq = int.Parse(Database.runRead("SELECT equipped FROM user_items WHERE id = " + tempID));

                if (tempEq == 1)
                    _item.Equipped = true;
                else
                    _item.Equipped = false;
            }
        }
Exemple #3
0
        public static void loadItems(int userID)
        {
            int[] itemIDs = Database.runReadColumnIntegers("SELECT id FROM user_items WHERE user_id = " + userID, 0);

            foreach (int tempID in itemIDs)
            {
                Users.Item _item = new Users.Item(tempID);
                _item.ItemID = int.Parse(Database.runRead("SELECT item_id FROM user_items WHERE id = " + tempID));
                _item.UserID = int.Parse(Database.runRead("SELECT user_id FROM user_items WHERE id = " + tempID));

                int tempEq = int.Parse(Database.runRead("SELECT equipped FROM user_items WHERE id = " + tempID));

                if (tempEq == 1)
                {
                    _item.Equipped = true;
                }
                else
                {
                    _item.Equipped = false;
                }
            }
        }