diff --git a/src/shan.cpp b/src/shan.cpp index 69e67c5..4b4654f 100644 --- a/src/shan.cpp +++ b/src/shan.cpp @@ -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++) { @@ -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]); // 裏ドラあり diff --git a/src/shan.h b/src/shan.h index 6284d24..80965eb 100644 --- a/src/shan.h +++ b/src/shan.h @@ -70,7 +70,6 @@ class Shan { std::vector _libaopai; // 里宝牌(裏ドラ) bool _weikaigang; // 未开杠(未開槓) bool _closed; - std::mt19937_64* _engine; }; inline std::ostream& operator<<(std::ostream& os, const Shan& shan) {