@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); } }
private void pickUpDrunkard(GameObject collision) { goal = policeStation; firePickUpEvent((StaticGameObject) collision); updatePosition(collision.getPosition()); lockedCounter = 0; }