package projectzombie.menu.gui;

import projectzombie.inventory.IInventory;
import projectzombie.util.ItemStack;

public class GUIItemSlotGetterStorage implements GUIItemSlotGetter
{
	private IInventory inventory;
	private int index;
	
	public GUIItemSlotGetterStorage(IInventory inventory, int index) {
		this.inventory = inventory;
		this.index = index;
	}

	@Override
	public boolean isAllowed(ItemStack stack) {
		return true;
	}

	@Override
	public ItemStack getItemStack() {
		return inventory.getItem(index);
	}

	@Override
	public void setItemStack(ItemStack stack) {
		inventory.setItem(stack, index);
	}

}
