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

Method WinningMove

library/src/moves/moves.cpp:351–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

349}
350
351inline auto Moves::WinningMove(const MoveType &mvp1, const ExtCard &mvp2,
352 const int ourTrump) const -> bool {
353 /* Return true if move 1 wins over move 2, with the assumption that
354 move 2 is the presently winning card of the trick */
355
356 if (mvp1.suit == mvp2.suit) {
357 if (mvp1.rank > mvp2.rank)
358 return true;
359 else
360 return false;
361 } else if (mvp1.suit == ourTrump)
362 return true;
363 else
364 return false;
365}
366
367auto Moves::GetLength(const int trick, const int relHand) const -> int {
368 return moveList[trick][relHand].last + 1;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected