public Resources_Inventory(string id, Item_Weapon_Gun gun, Item_Weapon_Melee melee, Item_Gear_Clothes clothes, Item_Gear_Shoes shoes, Item_Gear_Pin pin, Item_Gear_Neck neck, Item_Gear_Ring ring, Item_Gear_Wrist wrist, Item_Decay_Hair hair, Item_Decay_Flower flower) { _id = id; _gun = gun; _melee = melee; _clothes = clothes; _shoes = shoes; _pin = pin; _neck = neck; _ring = ring; _wrist = wrist; _hair = hair; _flower = flower; if(gun != null) { _inventory.Add (gun); } if(melee != null) { _inventory.Add (melee); } if(clothes != null) { _inventory.Add (clothes); } if(shoes != null) { _inventory.Add (shoes); } if(pin != null) { _inventory.Add (pin); } if(neck != null) { _inventory.Add (neck); } if(ring != null) { _inventory.Add (ring); } if(wrist != null) { _inventory.Add (wrist); } if(hair != null) { _inventory.Add (hair); } if(flower != null) { _inventory.Add (flower); } _inventories.Add (this); }
private void GenerateStartingInventoriesFromJSON() { for (int i = 0; i < _worldData["StartingInventories"].Count; i++) { JSONObject entry = _worldData["StartingInventories"][i]; JSONObject gunInfo = entry["gun"]; JSONObject meleeInfo = entry["melee"]; JSONObject clothesInfo = entry["clothes"]; JSONObject shoesInfo = entry["shoes"]; JSONObject pinInfo = entry["pin"]; JSONObject neckInfo = entry["neck"]; JSONObject ringInfo = entry["ring"]; JSONObject wristInfo = entry["wrist"]; JSONObject hairInfo = entry["hair"]; JSONObject flowerInfo = entry["flower"]; Item_Weapon_Gun gun = null; Item_Weapon_Melee melee = null; Item_Gear_Clothes clothes = null; Item_Gear_Shoes shoes = null; Item_Gear_Pin pin = null; Item_Gear_Neck neck = null; Item_Gear_Ring ring = null; Item_Gear_Wrist wrist = null; Item_Decay_Hair hair = null; Item_Decay_Flower flower = null; if (gunInfo != null) { gun = (Item_Weapon_Gun)Item_Root.GetItemByID(gunInfo.str); } if (meleeInfo != null) { melee = (Item_Weapon_Melee)Item_Root.GetItemByID(meleeInfo.str); } if (clothesInfo != null) { clothes = (Item_Gear_Clothes)Item_Root.GetItemByID(clothesInfo.str); } if (shoesInfo != null) { shoes = (Item_Gear_Shoes)Item_Root.GetItemByID(shoesInfo.str); } if (pinInfo != null) { pin = (Item_Gear_Pin)Item_Root.GetItemByID(pinInfo.str); } if (neckInfo != null) { neck = (Item_Gear_Neck)Item_Root.GetItemByID(neckInfo.str); } if (ringInfo != null) { ring = (Item_Gear_Ring)Item_Root.GetItemByID(ringInfo.str); } if (wristInfo != null) { wrist = (Item_Gear_Wrist)Item_Root.GetItemByID(wristInfo.str); } if (hairInfo != null) { hair = (Item_Decay_Hair)Item_Root.GetItemByID(hairInfo.str); } if (flowerInfo != null) { flower = (Item_Decay_Flower)Item_Root.GetItemByID(flowerInfo.str); } Resources_Inventory inventory = new Resources_Inventory(entry["id"].str, gun, melee, clothes, shoes, pin, neck, ring, wrist, hair, flower); } }
public void GetItem(Item_Root item) { _inventory.Add(item); switch (item.GetType().ToString()) { case "Item_Weapon_Gun": { _gun = (Item_Weapon_Gun)item; break; } case "Item_Weapon_Melee": { _melee = (Item_Weapon_Melee)item; break; } case "Item_Gear_Clothes": { _clothes = (Item_Gear_Clothes)item; break; } case "Item_Gear_Shoes": { _shoes = (Item_Gear_Shoes)item; break; } case "Item_Gear_Pin": { _pin = (Item_Gear_Pin)item; break; } case "Item_Gear_Neck": { _neck = (Item_Gear_Neck)item; break; } case "Item_Gear_Ring": { _ring = (Item_Gear_Ring)item; break; } case "Item_Gear_Wrist": { _wrist = (Item_Gear_Wrist)item; break; } case "Item_Decay_Hair": { _hair = (Item_Decay_Hair)item; break; } case "Item_Decay_Flower": { _flower = (Item_Decay_Flower)item; break; } case "Item_Consumable": { _consumables.Add((Item_Consumable)item); break; } } }
public Resources_Inventory(string id, Item_Weapon_Gun gun, Item_Weapon_Melee melee, Item_Gear_Clothes clothes, Item_Gear_Shoes shoes, Item_Gear_Pin pin, Item_Gear_Neck neck, Item_Gear_Ring ring, Item_Gear_Wrist wrist, Item_Decay_Hair hair, Item_Decay_Flower flower) { _id = id; _gun = gun; _melee = melee; _clothes = clothes; _shoes = shoes; _pin = pin; _neck = neck; _ring = ring; _wrist = wrist; _hair = hair; _flower = flower; if (gun != null) { _inventory.Add(gun); } if (melee != null) { _inventory.Add(melee); } if (clothes != null) { _inventory.Add(clothes); } if (shoes != null) { _inventory.Add(shoes); } if (pin != null) { _inventory.Add(pin); } if (neck != null) { _inventory.Add(neck); } if (ring != null) { _inventory.Add(ring); } if (wrist != null) { _inventory.Add(wrist); } if (hair != null) { _inventory.Add(hair); } if (flower != null) { _inventory.Add(flower); } _inventories.Add(this); }
public void GetItem(Item_Root item) { _inventory.Add (item); switch (item.GetType().ToString()) { case "Item_Weapon_Gun": { _gun = (Item_Weapon_Gun)item; break; } case "Item_Weapon_Melee": { _melee = (Item_Weapon_Melee)item; break; } case "Item_Gear_Clothes": { _clothes = (Item_Gear_Clothes)item; break; } case "Item_Gear_Shoes": { _shoes = (Item_Gear_Shoes)item; break; } case "Item_Gear_Pin": { _pin = (Item_Gear_Pin)item; break; } case "Item_Gear_Neck": { _neck = (Item_Gear_Neck)item; break; } case "Item_Gear_Ring": { _ring = (Item_Gear_Ring)item; break; } case "Item_Gear_Wrist": { _wrist = (Item_Gear_Wrist)item; break; } case "Item_Decay_Hair": { _hair = (Item_Decay_Hair)item; break; } case "Item_Decay_Flower": { _flower = (Item_Decay_Flower)item; break; } case "Item_Consumable": { _consumables.Add((Item_Consumable)item); break; } } }