public void MergeWithInventory(List <ItemContainerModel> itemContainers) { if (itemContainers.Count > 1) { Debug.LogError("MachineProcessorModel cannot have more then 1 item at a time"); } inputItem = itemContainers[0]; }
public void RemoveSelected() { if (inputItem != null) { inputItem = null; } if (outputItem != null) { outputItem = null; } }
public void SetItemsFromContainer(ItemContainerModel itemContainer) { for (int i = 0; i < itemContainer.item_instances.Length; i++) { for (int j = 0; j < itemContainer.items.Length; j++) { if (itemContainer.items[j].item_id == itemContainer.item_instances[i].item_id) { this.CreateItemSlot(itemContainer.item_instances[i], itemContainer.items[j], i); } } } }
public iComponentModel[] GetData() { scrollList = new ScrollListModel[1]; scrollModels = new List <ItemContainerModel>(); for (int i = 0; i < testItems.Length; i++) { ItemContainerModel gridItem = new ItemContainerModel(); gridItem.item = testItems[i].itemData; scrollModels.Add(gridItem); } scrollList[0] = new ScrollListModel(91);//with a max amount of 91 scrollList[0].gridItems = scrollModels; return(scrollList); }
void AddToCorrectContainer(Item item) { if (selectedWorldObject.itemTypesAbleToReceive.Contains(item.name)) { inputItem = new ItemContainerModel() { item = item }; } if (selectedWorldObject.itemTypesAbleToDispatch.Contains(item.name)) { outputItem = new ItemContainerModel() { item = item }; } }