protected void rotateToHits(Unit U, HitIndicator I) {
    // rotate unit to face indicator direction

    // 0 up, 1 right, 2 down, 3 left

    while (!(U.getDirectionFacing() == I.getDirection())) {
      if (U.getDirectionFacing() == 0) {
        if (I.getDirection() == 3) U.rotateLeft();
        else U.rotateRight();
      } else if (U.getDirectionFacing() == 1) {
        if (I.getDirection() == 0) U.rotateLeft();
        else U.rotateRight();
      } else if (U.getDirectionFacing() == 2) {
        if (I.getDirection() == 1) U.rotateLeft();
        else U.rotateRight();
      } else if (U.getDirectionFacing() == 3) {
        if (I.getDirection() == 2) U.rotateLeft();
        else U.rotateRight();
      } else return; // error

      U.usePoints(U.getRotationCost());
    }
  }