pacworld
Class Package
java.lang.Object
pacworld.Package
public class Package
- extends java.lang.Object
A package for the package delivery world.
Constructor Summary |
Package(int i,
int destId,
int destX,
int destY)
Create a package by specifying its id and destination. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Package
public Package(int i,
int destId,
int destX,
int destY)
- Create a package by specifying its id and destination.
getAgent
public PacAgentRep getAgent()
- Return the agent that is holding the package. Return null if no agent is
holding it.
- Returns:
getId
public int getId()
getDestId
public int getDestId()
getDestX
public int getDestX()
getDestY
public int getDestY()
getX
public int getX()
getY
public int getY()
setX
public void setX(int newX)
setY
public void setY(int newY)
setAgent
public void setAgent(PacAgentRep agt)
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in class java.lang.Object