groupOf関数
リファレンスの説明と例は英語です。見出しと目次は日本語です。
The kind of dice one die of a roll belongs to, with its rules, faces and weights.
インポート
import { groupOf } from "@johnmorrisdotca/korokoro";
定義
function groupOf(spec: RollSpec, die: DieRoll): DiceGroup
引数
| 名前 | 型 | 説明 |
|---|---|---|
spec | RollSpec | Dice counts, sides, rules and modifier; omitted fields use the documented defaults. |
die | DieRoll | The logged die whose group is requested. |
戻り値
DiceGroup
The kind of dice one die of a roll belongs to, with its rules, faces and weights.
例
import { groupOf } from "@johnmorrisdotca/korokoro";
import { diceOf, normalizeSpec, rollFrom } from "@johnmorrisdotca/korokoro";
const spec = normalizeSpec({ count: 2, sides: 6 });
const sample = rollFrom(spec, [2, 5], "saved", 0, null)!;
console.log(groupOf(spec, diceOf(sample)[0]!).sides);6出力(このページを作ったときに実行した結果)
この日本語は、まだ日本語を母語とする方の確認を受けていません。訂正を歓迎します。