public ItemStackButton(IGameWindow window, Camera<OrthographicProjection> camera, Vector2 position, ItemStack itemStack, Key? hotkey = null) : base(window, camera, position, null, hotkey) { ItemStack = itemStack; }
public bool IsCompatibleWith(ItemStack other) { return (ItemId == other.ItemId) && (Metadata == other.Metadata); }
public void ReceiveItem(Item item) { var itemStack = new ItemStack(item.Id); if (Toolbelt.HasCompatibleSlot(itemStack)) { Toolbelt.SetFirstCompatibleSlot(itemStack); } else if (Inventory.HasCompatibleSlot(itemStack)) { Inventory.SetFirstCompatibleSlot(itemStack); } else { throw new InvalidOperationException("The inventories are all full!"); } }