package projectzombie.inventory;

import projectzombie.util.ClassBdf;
import projectzombie.util.ItemStack;
import bdf.types.BdfNamedList;
import bdf.types.BdfObject;

public class InventoryClothing implements ClassBdf, IInventoryClothing
{
	private ItemStack shirt, pants, boots;
	
	public InventoryClothing() {
		shirt = ItemStack.getEmpty();
		pants = ItemStack.getEmpty();
		boots = ItemStack.getEmpty();
	}
	
	public InventoryClothing(BdfObject bdf) {
		BdfClassLoad(bdf);
	}

	@Override
	public ItemStack getShirt() {
		return shirt;
	}

	@Override
	public ItemStack getPants() {
		return pants;
	}

	@Override
	public ItemStack getBoots() {
		return boots;
	}
	
	@Override
	public void setShirt(ItemStack stack) {
		shirt = stack;
	}

	@Override
	public void setPants(ItemStack stack) {
		pants = stack;
	}

	@Override
	public void setBoots(ItemStack stack) {
		boots = stack;
	}

	@Override
	public void BdfClassLoad(BdfObject bdf) {
		BdfNamedList nl = bdf.getNamedList();
		shirt = new ItemStack(nl.get("shirt"));
		pants = new ItemStack(nl.get("pants"));
		boots = new ItemStack(nl.get("boots"));
	}

	@Override
	public void BdfClassSave(BdfObject bdf) {
		BdfNamedList nl = bdf.newNamedList();
		shirt.BdfClassSave(nl.get("shirt"));
		pants.BdfClassSave(nl.get("pants"));
		boots.BdfClassSave(nl.get("boots"));
		bdf.setNamedList(nl);
	}
}
