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

Method GetTrickData

library/src/moves/moves.cpp:604–625  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

602}
603
604auto Moves::GetTrickData(const int tricks) -> const TrickDataType & {
605 TrickDataType &data = track[tricks].trick_data;
606 for (int s = 0; s < DDS_SUITS; s++)
607 data.play_count[s] = 0;
608 for (int relh = 0; relh < DDS_HANDS; relh++)
609 data.play_count[trackp->play_suits[relh]]++;
610
611#ifndef NDEBUG
612 int sum = 0;
613 for (int s = 0; s < DDS_SUITS; s++)
614 sum += data.play_count[s];
615
616 // Internal invariant: exactly 4 cards must be played per trick
617 assert(sum == 4 && "GetTrickData: play_count sum must equal 4");
618#endif
619
620 data.best_rank = trackp->move[3].rank;
621 data.best_suit = trackp->move[3].suit;
622 data.best_sequence = trackp->move[3].sequence;
623 data.rel_winner = trackp->high[3];
624 return data;
625}
626
627auto Moves::Sort(const int tricks, const int relHand) -> void {
628 numMoves = moveList[tricks][relHand].last + 1;

Callers 1

get_trick_dataMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected