| 186 | |
| 187 | |
| 188 | void SetDeal( |
| 189 | const std::shared_ptr<ThreadData>& thrp) |
| 190 | { |
| 191 | /* Initialization of the rel structure is inspired by |
| 192 | a solution given by Thomas Andrews */ |
| 193 | |
| 194 | for (int s = 0; s < DDS_SUITS; s++) |
| 195 | { |
| 196 | thrp->lookAheadPos.aggr[s] = 0; |
| 197 | for (int h = 0; h < DDS_HANDS; h++) |
| 198 | { |
| 199 | thrp->lookAheadPos.rank_in_suit[h][s] = thrp->suit[h][s]; |
| 200 | thrp->lookAheadPos.aggr[s] |= thrp->suit[h][s]; |
| 201 | } |
| 202 | } |
| 203 | |
| 204 | for (int s = 0; s < DDS_SUITS; s++) |
| 205 | { |
| 206 | for (int h = 0; h < DDS_HANDS; h++) |
| 207 | thrp->lookAheadPos.length[h][s] = static_cast<unsigned char>( |
| 208 | count_table[thrp->lookAheadPos.rank_in_suit[h][s]]); |
| 209 | } |
| 210 | |
| 211 | // Clubs are implicit, for a given trick number. |
| 212 | for (int h = 0; h < DDS_HANDS; h++) |
| 213 | { |
| 214 | thrp->lookAheadPos.hand_dist[h] = |
| 215 | static_cast<long long>( |
| 216 | (thrp->lookAheadPos.length[h][0] << 8) | |
| 217 | (thrp->lookAheadPos.length[h][1] << 4) | |
| 218 | (thrp->lookAheadPos.length[h][2] )); |
| 219 | } |
| 220 | } |
| 221 | |
| 222 | |
| 223 | void SetDealTables( |
no outgoing calls
no test coverage detected