package de.rico.adventure.entity.item;

import de.rico.adventure.entity.AbstractEntity;
import de.rico.engine.effect.ortho.OverlayImage;
import de.rico.engine.geometry.AbstractMesh;

/**
 * This class represents an item in the advenure.
 * @author Frank Bruns
 *
 */
public class Item extends AbstractEntity
{
	// inventory image
	private OverlayImage iventImg = null;

	/**
	 * Flag for signaling, if the item can be picked up by a
	 * character. The identifier "canBePickedUp" doesn't stick
	 * to Java's style guide very much, I know, but the label
	 * "isPickable" is already in use for the engine's picking
	 * methods (OpenGL internal or picking ray).
	 */
	boolean canBePickedUp = true;

	/**
	 * Creates a new item with the specified mesh as a model.
	 * @param mesh mesh to use for the item
	 */
	public Item(AbstractMesh mesh)
	{
		super(mesh);
	}

	/**
	 * Sets the inventory image of the item to the
	 * specified overlay image object
	 * @param img overlay image for item's invetory representation
	 */
	public void setInventoryImage(OverlayImage img)
	{
		this.iventImg = img;
	}

	/**
	 * Sets the inventory image of the item to the
	 * specified image specified by the file path.
	 * @param filePath path to image for item's invetory representation
	 */
	public void setInventoryImage(String filePath)
	{
		this.iventImg = new OverlayImage(filePath);
	}

	/**
	 * Returns the overlay image object that is used as the item's
	 * inventory representation.
	 * @return inventory image of the item
	 */
	public OverlayImage getInventoryImage()
	{
		return this.iventImg;
	}


	/**
	 * Determines whethter or not the item can be picked up by a
	 * character.
	 * @return can be picked up? --> true=yes, false=no
	 */
	public boolean canBePickedUp()
	{
		return this.canBePickedUp;
	}


	/**
	 * Sets whethter or not the item can be picked up by a
	 * character.
	 * @param pickUp can be picked up? --> true=yes, false=no
	 */
	public void setCanBePickedUp(boolean pickUp)
	{
		this.canBePickedUp = pickUp;
	}
}
