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.h
Line
Count
Source
1
#pragma once
2
#include "types/yaku.h"
3
4
namespace mahjong {
5
class Yakus {
6
 public:
7
5.62k
  static Yakus& Instance() {
8
5.62k
    static Yakus yakus;
9
5.62k
    return yakus;
10
5.62k
  }
11
12
  const std::vector<Yaku>& GetYakus();
13
  bool RegisterYaku(const Yaku& yaku);
14
  bool RegisterYakus(const std::vector<Yaku>& yakus);
15
16
 private:
17
  Yakus() = default;
18
19
  std::vector<Yaku> yakus_;
20
};
21
22
#define REGISTER_YAKU(...)                                                \
23
  namespace {                                                             \
24
  bool __registered = Yakus::Instance().RegisterYaku((Yaku __VA_ARGS__)); \
25
  }
26
27
#define REGISTER_YAKUS(...)                                            \
28
  namespace {                                                          \
29
  bool __registered =                                                  \
30
      Yakus::Instance().RegisterYakus(std::vector<Yaku>(__VA_ARGS__)); \
31
  }
32
33
}  // namespace mahjong