public class Package extends BoardItem {
  private int id;
  private int weight;
  private int destX;
  private int destY;
  private Environment env;

  public Package(int id, int x, int y, Environment env) {
    super(x, y);
    this.id = id;
    this.env = env;
  }

  public Node getDestinationNode() {
    return new Node(getDestX(), getDestY(), env);
  }

  public Node getNode() {
    return new Node(getX(), getY(), env);
  }

  public void drop() {
    env.setCondition(x, y, Environment.DROPPED);
  }

  public int getId() {
    return id;
  }

  public int getWeight() {
    return weight;
  }

  protected void setWeight(int weight) {
    this.weight = weight;
  }

  public int getDestX() {
    return destX;
  }

  protected void setDestX(int destX) {
    this.destX = destX;
  }

  public int getDestY() {
    return destY;
  }

  protected void setDestY(int destY) {
    this.destY = destY;
  }

  public boolean equals(Object obj) {
    if (obj instanceof Package)
      return ((Package) obj).getId() == id;
    return false;
  }
}
