mirror of
https://github.com/kierankihn/uno-game.git
synced 2025-12-27 10:23:16 +08:00
28 lines
499 B
C++
28 lines
499 B
C++
/**
|
|
* @file utils.cpp
|
|
*
|
|
* @author Yuzhe Guo
|
|
* @date 2025.11.15
|
|
*/
|
|
#include "Utils.h"
|
|
|
|
namespace UNO::COMMON {
|
|
Random::Random() : rd_(), gen_(rd_()) {}
|
|
std::mt19937 &Random::getGenerator() {
|
|
return gen_;
|
|
}
|
|
|
|
Utils* Utils::instance_ = nullptr;
|
|
|
|
Utils *Utils::getInstance() {
|
|
if (instance_ == nullptr) {
|
|
instance_ = new Utils();
|
|
}
|
|
return instance_;
|
|
}
|
|
Random &Utils::getRandom() {
|
|
return this->random_;
|
|
}
|
|
|
|
|
|
} // UNO
|