Coverage Report

Created: 2025-09-03 03:49

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/nix/store/i1aar97n7b4yf8rk94p66if25brfvvdx-gqvzl8a5pvrg3xj44q0msrndcripi8dk-source/src/scoring/yakus/blessingofman.cc
Line
Count
Source
1
#include "scoring/yakus/blessingofman.h"
2
3
#include <vector>
4
5
#include "analysis/handnode.h"
6
#include "scoring/yakus.h"
7
#include "types/gamestate.h"
8
#include "types/yaku.h"
9
10
namespace mahjong::yaku {
11
bool isBlessingOfMan(const GameState& state, int player,
12
13
                     const std::vector<const mahjong::Node*>& /*branch*/) {
13
13
  if (state.hands.at(player).open) {
14
0
    return false;
15
0
  }
16
13
  if (state.turnNum > player) {
17
4
    return false;
18
4
  }
19
9
  if (state.lastCall >= 0) {
20
4
    return false;
21
4
  }
22
5
  if (state.hasRonned.at(player)) {
23
1
    return true;
24
1
  }
25
4
  return false;
26
5
}
27
28
REGISTER_YAKU({
29
    .id = "blessingofman",
30
    .name = "Blessing of Man",
31
    .type = Yaku::kYakuman,
32
    .value = 13,
33
    .is_yaku_func = yaku::isBlessingOfMan,
34
});
35
}  // namespace mahjong::yaku