示例#1
0
 @Override
 public void collisionPerformed(GameObject collision) {
   if (collision instanceof Policeman) {
     fireFallEvent(new StandingPoliceman(getPosition()));
   } else if (collision.getPosition().equals(goal)
       && (collision instanceof SleepingDrunkard || collision instanceof LyingDrunkard)) {
     pickUpDrunkard(collision);
   } else {
     lockedCounter = 10;
     fireMoveEvent(this);
   }
 }
示例#2
0
 private void pickUpDrunkard(GameObject collision) {
   goal = policeStation;
   firePickUpEvent((StaticGameObject) collision);
   updatePosition(collision.getPosition());
   lockedCounter = 0;
 }