Skip to content

Commit

Permalink
fix: don't require pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
paithiov909 committed Oct 31, 2024
1 parent 0139c6f commit b88de4e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/shan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace cmajiang {

Shan::Shan(const Rule& rule, std::mt19937_64& mt)
: _rule(rule), _weikaigang(false), _closed(false), _engine(&mt) {
: _rule(rule), _weikaigang(false), _closed(false) {
for (const auto s : {'m', 'p', 's', 'z'}) {
for (int n = 1; n <= (s == 'z' ? 7 : 9); n++) {
for (int i = 0; i < 4; i++) {
Expand All @@ -16,7 +16,7 @@ Shan::Shan(const Rule& rule, std::mt19937_64& mt)
}
}
}
std::shuffle(_pai.begin(), _pai.end(), *_engine);
std::shuffle(_pai.begin(), _pai.end(), mt);

_baopai.emplace_back(_pai[4]);
// 裏ドラあり
Expand Down
1 change: 0 additions & 1 deletion src/shan.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Shan {
std::vector<std::string> _libaopai; // 里宝牌(裏ドラ)
bool _weikaigang; // 未开杠(未開槓)
bool _closed;
std::mt19937_64* _engine;
};

inline std::ostream& operator<<(std::ostream& os, const Shan& shan) {
Expand Down

0 comments on commit b88de4e

Please sign in to comment.