Slope tileh_north_aqueduct = GetTileSlope(tile_start); if (tileh_north_aqueduct != ComplementSlope(tileh_end)) { Slope tileh_north_result; switch (tileh_end) { case SLOPE_NE: switch (tileh_north_aqueduct) { case SLOPE_S: case SLOPE_STEEP_S: tileh_north_result = SLOPE_W; break; case SLOPE_W: case SLOPE_STEEP_W: tileh_north_result = SLOPE_S; break; default: NOT_REACHED(); } break; case SLOPE_NW: switch (tileh_north_aqueduct) { case SLOPE_E: case SLOPE_STEEP_E: tileh_north_result = SLOPE_S; break; case SLOPE_S: case SLOPE_STEEP_S: tileh_north_result = SLOPE_E; break; default: NOT_REACHED(); } break; case SLOPE_SW: switch (tileh_north_aqueduct) { case SLOPE_N: case SLOPE_STEEP_N: tileh_north_result = SLOPE_E; break; case SLOPE_E: case SLOPE_STEEP_E: tileh_north_result = SLOPE_N; break; default: NOT_REACHED(); } break; case SLOPE_SE: switch (tileh_north_aqueduct) { case SLOPE_W: case SLOPE_STEEP_W: tileh_north_result = SLOPE_N; break; case SLOPE_N: case SLOPE_STEEP_N: tileh_north_result = SLOPE_W; break; default: NOT_REACHED(); } break; default: NOT_REACHED(); }