public boolean canRobotMove(Direction direction) {
		boolean result = true;
		/* Each case checks for 2 things: if the robot will move outside of the bounds
		 * and if there is a rock in the robot's path.
		 */
		switch(direction) {
		case UP:
			result &= robot.getLocation().y > 0;
			result &= !rocks.contains(new Rectangle(robot.getLocation().x,
					robot.getLocation().y - UNIT, UNIT, UNIT));
			break;
		case DOWN:
			result &= robot.getLocation().y < 5175;	// 5175 = the bottom of the map
			result &= !rocks.contains(new Rectangle(robot.getLocation().x,
					robot.getLocation().y + UNIT, UNIT, UNIT));
			break;
		case LEFT:
			result &= robot.getLocation().x > 0;
			result &= !rocks.contains(new Rectangle(robot.getLocation().x - UNIT,
					robot.getLocation().y, UNIT, UNIT));
			break;
		case RIGHT:
			result &= robot.getLocation().x < yamg.getFrameBounds().width - UNIT;
			result &= !rocks.contains(new Rectangle(robot.getLocation().x + UNIT,
					robot.getLocation().y, UNIT, UNIT));
			break;
		}
		result &= robot.getFuelTank().getFuelLevel() > 0;
		return result;
	}