Monopoly — Portage moderne
0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
RuleRandom.cpp
Go to the documentation of this file.
1
#include "
RuleRandom.hpp
"
2
3
#include <chrono>
4
5
namespace
monopoly::rules::random
6
{
7
namespace
8
{
9
std::mt19937
globalGenerator
;
10
}
11
12
void
initialize
()
13
{
14
const
auto
seed
=
15
static_cast<
std::mt19937::result_type
>
(
16
std::chrono::steady_clock::now()
17
.time_since_epoch()
18
.count()
19
);
20
21
globalGenerator
.seed(
seed
);
22
}
23
24
void
seed
(std::uint32_t
value
)
25
{
26
globalGenerator
.seed(
value
);
27
}
28
29
30
std::mt19937&
generator
()
31
{
32
return
globalGenerator
;
33
}
34
}
35
index
unsigned index
Definition
ModernIBarSkin.cpp:25
RuleRandom.hpp
value
std::uint16_t value
Definition
Timers.cpp:16
monopoly::rules::random
Definition
RuleRandom.cpp:6
monopoly::rules::random::initialize
void initialize()
Definition
RuleRandom.cpp:12
monopoly::rules::random::generator
std::mt19937 & generator()
Definition
RuleRandom.cpp:30
monopoly::rules::random::seed
void seed(std::uint32_t value)
Definition
RuleRandom.cpp:24
RuleRandom.cpp
Generated by
1.9.8