public void tryCraftItem_neededItemIn1Slot() { CraftingEntries.Add(new CraftingEntry(new[] { new Item(3, BlockType.Dirt) }, new Item(1, BlockType.DiamondOre), BlockType.WoodPixaxe)); Inventory.Inventory.Add(new Item(3, BlockType.Dirt)); var flag = Instance.Craft(Inventory, BlockType.DiamondOre); Assert.IsTrue(flag); Assert.IsTrue(Inventory.Inventory.Find(s => s.Type == BlockType.DiamondOre).Count == 1); Assert.IsNull(Inventory.Inventory.FirstOrDefault(s => s.Type == BlockType.Dirt)); }
private void CraftItem(PixControl obj) { var item = allCraftings.radios[allCraftings.Selection].ObjectToRepresent as CraftingEntry; craftingSystem.Craft(inventory, item.CraftedItem.Type); RefreshInventory(); Thread.Sleep(100); }