Exemple #1
0
  public void updatePosition() {
    if (xPos < xDestination) xPos++;
    else if (xPos > xDestination) xPos--;

    if (yPos < yDestination) yPos++;
    else if (yPos > yDestination) yPos--;
    if ((xPos == xDestination && yPos == yDestination)
        && (xPos == xPlatingArea)
        && (yPos == yPlatingArea)) {
      agent.msgAtPlatingArea();
    }
    if ((xPos == xDestination && yPos == yDestination)
        && (xPos == xKitchen)
        && (yPos == yKitchen)) {
      agent.msgAtKitchen();
    }
    if ((xPos == xDestination && yPos == yDestination)
        && (xPos == xDefault)
        && (yPos == yDefault)) {
      agent.msgAtDefault();
    }
  }
Exemple #2
0
 public String getName() {
   return agent.getName();
 }