//! Create inventory item instance. public InventoryItemInstance Create(string Name, sbyte Status) { ja2.InventoryItemInstance instance; // Load inventory as first var inventory_item = inventoryItemManager.load(Name); // Based on type create instance switch (inventory_item._2.type) { case "torso_clothing": instance = new ja2.InventoryItemInstanceTorsoClothing(inventory_item._1, Status, new ja2.TorsoClothing(inventory_item._2.src)); break; case "head_clothing": instance = new ja2.InventoryItemInstanceHeadClothing(inventory_item._1, Status, new ja2.HeadClothing(inventory_item._2.src)); break; default: throw new Exception("Unknown inventory item type."); } return instance; }
//! Create inventory item instance. public InventoryItemInstance Create(string Name, sbyte Status) { ja2.InventoryItemInstance instance; // Load inventory as first var inventory_item = inventoryItemManager.load(Name); // Based on type create instance switch (inventory_item._2.type) { case "torso_clothing": instance = new ja2.InventoryItemInstanceTorsoClothing(inventory_item._1, Status, new ja2.TorsoClothing(inventory_item._2.src)); break; case "head_clothing": instance = new ja2.InventoryItemInstanceHeadClothing(inventory_item._1, Status, new ja2.HeadClothing(inventory_item._2.src)); break; default: throw new Exception("Unknown inventory item type."); } return(instance); }