| 1025 | |
| 1026 | |
| 1027 | int QuickTricksPartnerHandNT( |
| 1028 | const int hand, |
| 1029 | Pos& tpos, |
| 1030 | const int cutoff, |
| 1031 | const int depth, |
| 1032 | const int countLho, |
| 1033 | const int countRho, |
| 1034 | const int countOwn, |
| 1035 | const int countPart, |
| 1036 | const int suit, |
| 1037 | const int qtricks, |
| 1038 | const int commSuit, |
| 1039 | const int commRank, |
| 1040 | int& res, |
| 1041 | SolverContext& ctx) |
| 1042 | { |
| 1043 | res = 1; |
| 1044 | int qt = qtricks; |
| 1045 | |
| 1046 | tpos.win_ranks[depth][suit] |= |
| 1047 | bit_map_rank[tpos.winner[suit].rank]; |
| 1048 | |
| 1049 | tpos.win_ranks[depth][commSuit] |= bit_map_rank[commRank]; |
| 1050 | |
| 1051 | qt++; |
| 1052 | if (qt >= cutoff) |
| 1053 | return qt; |
| 1054 | if ((countLho <= 1) && (countRho <= 1) && (countOwn <= 1)) |
| 1055 | { |
| 1056 | qt += countPart - 1; |
| 1057 | if (qt >= cutoff) |
| 1058 | return qt; |
| 1059 | res = 2; |
| 1060 | return qt; |
| 1061 | } |
| 1062 | |
| 1063 | if (tpos.second_best[suit].hand == partner[hand]) |
| 1064 | { |
| 1065 | /* Second best found in partners hand */ |
| 1066 | tpos.win_ranks[depth][suit] |= |
| 1067 | bit_map_rank[tpos.second_best[suit].rank]; |
| 1068 | |
| 1069 | qt++; |
| 1070 | if (qt >= cutoff) |
| 1071 | return qt; |
| 1072 | if ((countLho <= 2) && (countRho <= 2) && (countOwn <= 2)) |
| 1073 | { |
| 1074 | qt += countPart - 2; |
| 1075 | if (qt >= cutoff) |
| 1076 | return qt; |
| 1077 | res = 2; |
| 1078 | return qt; |
| 1079 | } |
| 1080 | } |
| 1081 | else if ((tpos.second_best[suit].hand == hand) |
| 1082 | && (countPart > 1) && (countOwn > 1)) |
| 1083 | { |
| 1084 | /* Second best found in own hand and own and |