package org.apollo.game.event.impl;

import org.apollo.game.event.Event;
import org.apollo.game.model.Item;

/**
 * An {@link Event} sent to tell the client to update the amount of an item display on a tile.
 * 
 * @author Major
 */
public final class UpdateTileItemEvent extends Event {

	/**
	 * The {@link Item}.
	 */
	private final Item item;

	/**
	 * The offset from the client's base position.
	 */
	private final int positionOffset;

	/**
	 * The previous amount of the item (if it is being updated).
	 */
	private final int previousAmount;

	/**
	 * Creates a new event that updates the previous amount of the item.
	 * 
	 * @param id The id of the item.
	 * @param amount The amount of the item.
	 * @param previousAmount The previous amount of the item.
	 */
	public UpdateTileItemEvent(Item item, int previousAmount) {
		this(item, previousAmount, 0);
	}

	/**
	 * Creates a new set tile item event.
	 * 
	 * @param id The id of the item.
	 * @param amount The new amount of the item.
	 * @param stackable Whether the item is stackable or not.
	 * @param positionOffset The offset from the client's base position.
	 * @param updating If the item is being updated or not.
	 * @param previousAmount The previous amount of the item.
	 */
	public UpdateTileItemEvent(Item item, int previousAmount, int positionOffset) {
		this.item = item;
		this.previousAmount = previousAmount;
		this.positionOffset = positionOffset;
	}

	/**
	 * Gets the amount of the item.
	 * 
	 * @return The amount.
	 */
	public int getAmount() {
		return item.getAmount();
	}

	/**
	 * Gets the id of the item.
	 * 
	 * @return The item.
	 */
	public int getId() {
		return item.getId();
	}

	/**
	 * Gets the offset from the client's base position.
	 * 
	 * @return The offset.
	 */
	public int getPositionOffset() {
		return positionOffset;
	}

	/**
	 * Gets the previous amount of the item.
	 * 
	 * @return The previous amount.
	 */
	public int getPreviousAmount() {
		return previousAmount;
	}

}
@@ -646,63 +646,24 @@
 he i
-d of the item.%0A%09 * @param amount The amount of the item
+tem to be placed
 .%0A%09 
@@ -886,37 +886,40 @@
 ram id The i
-d of the item
+tem to be placed
 .%0A%09 * @param
@@ -919,17 +919,25 @@
  @param 
-a
+previousA
 mount Th
@@ -938,19 +938,24 @@
 unt The 
-new
+previous
  amount 
@@ -982,240 +982,65 @@
 ram 
-stackable Whether the item is stackable or not.%0A%09 * @param positionOffset The offset from the client's base position.%0A%09 * @param updating If the item is being updated or not.%0A%09 * @param previousAmount The previous amount of the item
+positionOffset The offset from the client's base position
 .%0A%09 

Correct incomplete documentation in UpdateTileItemEvent.