ゲーム中のダイス処理
[詳細]
#include <Dice.h>
|
template<class Archive > |
void | serialize (Archive &archive, const unsigned int fileVersion) |
| クラスのシリアライズ化を設定する [詳細]
|
|
ゲーム中のダイス処理
Dice.h の 15 行で定義されています。
コンストラクタ
Dice.cpp の 14 行で定義されています。
void Set(int num, int side)
ダイスの数値設定を行う。
Dice::Dice |
( |
int |
num, |
|
|
int |
side |
|
) |
| |
コンストラクタ
ダイスの数 ダイスの面
Dice.cpp の 19 行で定義されています。
void Set(int num, int side)
ダイスの数値設定を行う。
ダイスを振る
- 戻り値
- ダイスの総計値
Dice.cpp の 53 行で定義されています。
static int Rand1(int max)
1を最小値とした乱数を返す
int Dice::Cast |
( |
int |
num, |
|
|
int |
side |
|
) |
| |
|
static |
ダイスを振る
- 引数
-
- 戻り値
- ダイスの総計値
Dice.cpp の 60 行で定義されています。
static int Rand1(int max)
1を最小値とした乱数を返す
int Dice::GetNum |
( |
void |
| ) |
|
int Dice::GetSide |
( |
void |
| ) |
|
void Dice::Initialize |
( |
void |
| ) |
|
|
static |
乱数初期化関数
- 戻り値
- なし
Dice.cpp の 34 行で定義されています。
36 std::random_device rd;
37 std::array<unsigned, 100> seeds;
38 for(
auto & s : seeds) s = rd();
39 std::seed_seq seq(seeds.begin(), seeds.end());
int Dice::MaxCast |
( |
void |
| ) |
|
ダイスの取り得る最大値を返す
- 戻り値
- ダイスの最大値
Dice.cpp の 67 行で定義されています。
int Dice::MaxCast |
( |
int |
num, |
|
|
int |
side |
|
) |
| |
|
static |
ダイスの取り得る最大値を返す
- 引数
-
- 戻り値
- ダイスの最大値
Dice.cpp の 72 行で定義されています。
int Dice::Rand0 |
( |
int |
max | ) |
|
|
static |
0を最小値とした乱数を返す
- 引数
-
- 戻り値
- 乱数の値
Dice.cpp の 77 行で定義されています。
79 std::uniform_int_distribution<int> dist(0, max-1);
int Dice::Rand1 |
( |
int |
max | ) |
|
|
static |
1を最小値とした乱数を返す
- 引数
-
- 戻り値
- 乱数の値
Dice.cpp の 83 行で定義されています。
static int Rand0(int max)
0を最小値とした乱数を返す
bool Dice::Saving |
( |
int |
diff | ) |
|
|
static |
セービング判定
- 引数
-
- 戻り値
- セービング成功ならば true を返す。
Dice.cpp の 88 行で定義されています。
90 std::normal_distribution<int> dist(0, 20);
91 return (diff >= dist(mt));
template<class Archive >
void Dice::serialize |
( |
Archive & |
archive, |
|
|
const unsigned int |
fileVersion |
|
) |
| |
|
inlineprivate |
クラスのシリアライズ化を設定する
- 引数
-
archive | アーカイブ化するクラスのアドレス |
fileVersion | ファイルバージョン |
- 戻り値
- XMLSerializeテンプレート
Dice.h の 30 行で定義されています。
33 archive & BOOST_SERIALIZATION_NVP(
num);
34 archive & BOOST_SERIALIZATION_NVP(
side);
void Dice::Set |
( |
int |
num, |
|
|
int |
side |
|
) |
| |
friend class boost::serialization::access |
|
friend |
このクラスの説明は次のファイルから生成されました:
- C:/Users/deskull/Works/SikabaneWorks/Deeangband/Deeangband-new/Deeangband/Dice.h
- C:/Users/deskull/Works/SikabaneWorks/Deeangband/Deeangband-new/Deeangband/Dice.cpp