MCPcopy Create free account
hub / github.com/dds-bridge/dds / InitWinners

Function InitWinners

library/src/init.cpp:304–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302
303
304void InitWinners(
305 const Deal& dl,
306 Pos& posPoint,
307 const std::shared_ptr<ThreadData>& thrp)
308{
309 int hand, suit, rank;
310 unsigned short int startMovesBitMap[DDS_HANDS][DDS_SUITS];
311
312 for (int h = 0; h < DDS_HANDS; h++)
313 for (int s = 0; s < DDS_SUITS; s++)
314 startMovesBitMap[h][s] = 0;
315
316 for (int k = 0; k < posPoint.hand_rel_first; k++)
317 {
318 hand = HAND_ID(dl.first, k);
319 suit = dl.currentTrickSuit[k];
320 rank = dl.currentTrickRank[k];
321 startMovesBitMap[hand][suit] |= bit_map_rank[rank];
322 }
323
324 int aggr;
325 for (int s = 0; s < DDS_SUITS; s++)
326 {
327 aggr = 0;
328 for (int h = 0; h < DDS_HANDS; h++)
329 aggr |= startMovesBitMap[h][s] | thrp->suit[h][s];
330
331 posPoint.winner[s].rank = thrp->rel[aggr].abs_rank[1][s].rank;
332 posPoint.winner[s].hand = thrp->rel[aggr].abs_rank[1][s].hand;
333 posPoint.second_best[s].rank = thrp->rel[aggr].abs_rank[2][s].rank;
334 posPoint.second_best[s].hand = thrp->rel[aggr].abs_rank[2][s].hand;
335 }
336}
337
338
339void STDCALL GetDDSInfo(DDSInfo * info)

Callers 1

solve_board_internalFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected