Coverage Report

Created: 2026-11-14 03:38

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/nix/store/rr0r40cw3mzzbz0sxrnkvnrjpzb82wpc-j27cjzgh5nmq3y8k6hwa6zpi3qgcjia8-source/src/scoring/yakus/sevenpairs.cc
Line
Count
Source
1
#include "scoring/yakus/sevenpairs.h"
2
3
#include <set>
4
#include <vector>
5
6
#include "analysis/handnode.h"
7
#include "scoring/yakus.h"
8
#include "types/gamestate.h"
9
#include "types/hand.h"
10
#include "types/piecetype.h"
11
#include "types/sets.h"
12
#include "types/yaku.h"
13
14
namespace mahjong::yaku {
15
bool isSevenPairs(const GameState& /* state */, const Hand& hand,
16
5
                  const std::vector<const mahjong::Node*>& branch) {
17
5
  if (hand.open) {
18
1
    return false;
19
1
  }
20
4
  std::set<Piece> pairs;
21
21
  for (const auto* node : branch) {
22
21
    switch (node->type()) {
23
1
      case SetType::kChi:
24
2
      case SetType::kPon:
25
2
      case SetType::kConcealedKan:
26
2
      case SetType::kKan:
27
2
      case SetType::kSingle:
28
2
        return false;
29
19
      case SetType::kPair:
30
19
        pairs.insert(node->start());
31
21
    }
32
21
  }
33
2
  return pairs.size() == 7;
34
4
}
35
36
REGISTER_YAKU({
37
    .id = "sevenpairs",
38
    .name = "Seven Pairs",
39
    .type = Yaku::kClosed,
40
    .value = 2,
41
    .is_yaku_func = yaku::isSevenPairs,
42
});
43
}  // namespace mahjong::yaku