chriscutts/dice-manager
Composer 安装命令:
composer require chriscutts/dice-manager
包简介
A package to manage and roll a set of dice then fetch the results
README 文档
README
A composer project to provide dice management
Description
A small package to be used for building a collection of dice, rolling them and then getting the results.
Installation
composer require chriscutts/dice-manager
Usage
Examples:
Create a manager
When creating the manager you can specify the quantity of dice and the number of sides in the first argument, or provide them seperately.
$manager = new DiceManager('2D6');
$manager = new DiceManager(2, 6);
Roll the dice
$manager->roll();
Get the combined total of the rolled dice
$manager->getTotal();
Get the rolled dice
$dice = $manager->getDice();
Loop through the dice and get the results
foreach ($dice as $die) {
echo $die->getResult();
}
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-06-14